<?php$oraUser = "user";
$oraPass = "password";
$oraDB = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.100)(PORT=1521)))(CONNECT_DATA=(SID=ORCL)))";$connection = oci_connect($oraUser,$oraPass,$oraDB)or die( "ORACLE server.............");$query = "SELECT id, name FROM fruits";$statement = oci_parse ($connection, $query);
oci_execute ($statement);while ($row = oci_fetch_array ($statement, OCI_BOTH)) {
echo $row[0]." and ".$row['ID']." is the same<br>";
echo $row[1]." and ".$row['NAME']." is the same<br>";
}?>
$oraPass = "password";
$oraDB = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.100)(PORT=1521)))(CONNECT_DATA=(SID=ORCL)))";$connection = oci_connect($oraUser,$oraPass,$oraDB)or die( "ORACLE server.............");$query = "SELECT id, name FROM fruits";$statement = oci_parse ($connection, $query);
oci_execute ($statement);while ($row = oci_fetch_array ($statement, OCI_BOTH)) {
echo $row[0]." and ".$row['ID']." is the same<br>";
echo $row[1]." and ".$row['NAME']." is the same<br>";
}?>
$sql="SELECT count(*) as num FROM ".$tqinfo_table." WHERE rq=to_date('".$rq."','YYYY-mm-dd')";
$result=OCIParse($conn,$sql);
OCIDefineByName($result,"NUM",$num);
OCIExecute($result);
OCIFetch($result);
OCILogoff($conn);
Return $num;
else:
Return -1;
OCILogoff($conn);
endif;