[請益] PHP使用oci函數寫資料入oracle資料庫的問題
程式如下:
$c = OCILogon('帳', '密', '//ip位置/資料庫名稱');
$query="INSERT into
webmed(no,chname,enname,seno,compo,guide,feature,indication,admin,attention,
conserve,sideeffect,corelation,he_restrict)
values('$no','$chname','$enname','$seno','$compo',
'$guide','$feature','$indication','$admin','$attention',
'$conserve','$sideeffect','$corelation','$he_restrict')";
$stid = OCIParse($c, $query);
OCIExecute($stid, OCI_DEFAULT);
$committed = oci_commit($c);
if (!$committed) {
$error = oci_error($conn);
echo 'Commit failed. Oracle reports: ' . $error['message'];
}
else{
echo "新增修改ok";
}
但committed只是確認SQL有沒有被執行,若像
Warning: ociexecute() [function.ociexecute]: ORA-01704: string literal too
long in C:\website\med\medpost.php on line 43
等這類問題,它還是會執行esle顯示新增修改ok,我要用什麼函數來控制當有warning的
訊息,只顯示warning的訊息。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.117.124.224
推
09/03 16:27, , 1F
09/03 16:27, 1F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章