呵呵,我们常用的函数:
function GetMatrixBindVer($strSQL,$BindVerName,$Color="blue")//miller yuan for bind variable
{
$debugstatus=$_SESSION["debugstatus"];
if($debugstatus=="on"){?>
<font color=<?=$Color?>> <A href="/webex/database.php?strSQL=<?=urlencode($strSQL)?>" target="new"> <b>debug:</b></A><?=htmlspecialchars($strSQL)?><br></font>
<?}
$conn=OCIConnect();
//Begin a transaction
//In anytime,set full time format
$stmt=OCIParse($conn,"ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY HH24:MI:SS'");
OCIExecute($stmt);
//Parse and run SQL
$stmt=OCIParse($conn,$strSQL);
$BindVerNameLength = sizeof($BindVerName);
for ($i=1;$i<=$BindVerNameLength;$i++)
{
OCIBindByName($stmt,$BindVerName[$i-1][0], &$BindVerName[$i-1][1], strlen($BindVerName[$i-1][1]));
}
$rtn = OCIExecute($stmt);
if(!$rtn)
{
print "This sql statement have errors:".$strSQL."<br>";
}
//Get column name to array
$ncols=OCINumCols($stmt);