php ติดต่อ Oracle

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: php ติดต่อ Oracle

ตอบละนะ

โดย boy1999 » 28/11/2007 10:28 pm

<?php
define ("login", "");
define ("pwd", "");
define ("host", "ARCGLOBE");
define ("db","GIS");

class Operation
{
var $_conn;
var $fields;
var $numrows;

function OracleOperation ()
{
$this->createConnection();
}

function createConnection()
{
//$this->_conn = OCILogon(login, pwd, host);
$link = @mssql_connect(host,login, pwd) or die("&auml;&Aacute;&egrave;&Ecirc;&Ograve;&Aacute;&Ograve;&Atilde;&para;&agrave;&ordf;&times;&egrave;&Iacute;&Aacute;&micro;&egrave;&Iacute;&deg;&Ograve;&sup1;&cent;&eacute;&Iacute;&Aacute;&Ugrave;&Aring;&auml;&acute;&eacute;");;
$this->_conn = @mssql_select_db(db,$link) or die("&deg;&Ograve;&sup1;&cent;&eacute;&Iacute;&Aacute;&Ugrave;&Aring;&auml;&Aacute;&egrave;&para;&Ugrave;&iexcl;&micro;&eacute;&Iacute;&sect;");;
}

function selectQuery($sql)
{
$this->createConnection();
//$stmt = OCIParse($this->_conn, $sql);
@mssql_query("set names 'tis620'");
//OCIExecute($stmt, OCI_DEFAULT);
$data = @mssql_query($sql);
$i = 0;
$this->numrows = @mssql_num_rows($data);
//while(OCIFetchInto ($stmt, $row, OCI_ASSOC))
while($i < $this->numrows)
{
//$this->fields[$i] = $row;
$this->fields[$i] = @mssql_fetch_assoc($data);
$i++;
}
//$this->numrows = $i;
return $data;
}

function sendQuery($sql)
{
$this->createConnection();
//echo $sql;
@mssql_query($sql);
//$stmt = OCIParse($this->_conn, $sql);
if(@msql_affected_rows() != -1){
return true;
}else{
return false;
}

}
}

โดย mindphp » 28/11/2007 3:02 am

ลองดูที่นี่ครับ
https://www.mindphp.com/modules.php?name ... .oci8.html

Oracle ที่มี database10g Developer suite 10g ครับ

โดย mini_pro » 27/11/2007 11:17 pm

Oracle ที่มี database10g Developer suite 10g ครับ ช่วยหน่อยนะครับผมอยากทราบ ขอบคุณครับ

โดย mindphp » 23/11/2007 3:18 am

ใช้ oracle เวอร์ชั่นไหนครับ

php ติดต่อ Oracle

โดย mini_pro » 23/11/2007 12:34 am

[color=orange][size=18][size=12][b]php เขียนติดต่อกับ Oracle ยังไง ขอคำสั่ง connect ด้วย[/b][/size][/size][/color][/b]

ข้างบน