|
|
|
(PHP+Oracle+BLOB) ORA-00947: มีค่าไม่เพียงพอ คืออะไรบอกหน่อย Warning: oci_execute() [function.oci-execute]: ORA-00947: มีค่าไม่เพียงพอ in |
|
|
|
|
|
|
|
จำนวน ฟิวด์ กับ จำนวน ค่า ไม่เท่ากันหรือเปล่าครับ
|
|
|
|
|
Date :
2009-05-07 17:57:16 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php
if (!isset($LEID)) exit;
include_once( "../../common/db_variable.php");
$CanEditAll=False;
if ($UserType==9) $CanEditAll=True;
if ($UserType==2) {
$getrq1=oci_parse($dblink,"SELECT COUNT(REFID) TEACH FROM T5_COURSE_INST WHERE USERID=$UserID AND COURSEID=$WKID");oci_execute($getrq1);
$GetRight=oci_fetch_array($getrq1);
If ($GetRight["TEACH"]>0) $CanEditAll=True;
}
if (isset($DeleteMessage) and ($MessageID>0))
{
if ((UserType==2) or ($UserType==9)) oci_execute(oci_parse($dblink,"DELETE FROM T5_TASKDISCUS WHERE MESSAGEID=$MessageID"));
else oci_execute(oci_parse($dblink,"DELETE FROM T5_TASKDISCUS WHERE MESSAGEID=$MessageID AND USERID=$UserID"));
}
if (isset($Send))
{
$fileName=NULL;
$data=NULL;
$fileType=NULL;
$fileSize=0;
if (is_uploaded_file($HTTP_POST_FILES['Attfile']['tmp_name']))
{
$fileName=$HTTP_POST_FILES['Attfile']['name'];
$fileTempName=$HTTP_POST_FILES['Attfile']['tmp_name'];
$fileSize=$HTTP_POST_FILES['Attfile']['size'];
$fileType=$HTTP_POST_FILES['Attfile']['type'];
if (($fileSize<=$maxupload_file_size) and ($fileSize>0))
{
$fp = fopen($fileTempName,"r");
$data=fread($fp,filesize($fileTempName));
//$data=addslashes($data);
fclose($fp);
}else {
$fileName=NULL;
$data=NULL;
$fileType=NULL;
$fileSize=0;
}
}
$Message=trim(text2db($Message));
$on2=oci_new_descriptor($dblink, OCI_D_LOB);
if ($MessageID==0) {
$sql="INSERT INTO T5_TASKDISCUS (COURSEID, LEID, TEAMID, USERID, MESSAGE, ATTFILE, ATTFILENAME, ATTFILESIZE, ATTFILETYPE, SUBMITDATE, FROMIP) ";
$sql.="VALUES($WKID, $LEID, $TeamID, $UserID,'$Message', EMPTRY_BLOB(), '$fileName', $fileSize, '$fileType', SYSDATE), '$IPs') RETURNING ATTFILE INTO :ATT";
}
else
{
if (($fileName<>NULL) and ($fileName<>""))
$sql="UPDATE T5_TASKDISCUS SET MESSAGE='$Message', ATTFILE=EMPTRY_BLOB(), ATTFILENAM='$fileName', ATTFILETYPE='$fileType', ATTFILESIZE=$fileSize WHERE MESSAGEID=$MessageID RETURNING ATTFILE INTO :ATT";
else $sql="UPDATE T5_TASKDISCUS SET MESSAGE='$Message' WHERE MESSAGEID=$MessageID";
}
if ((trim($Message)<>"") or (trim($fileName)<>""))
if($data==NULL){
$psql=oci_parse($dblink,$sql);
oci_execute($psql, OCI_DEFAULT);
}else{
$psql=oci_parse($dblink,$sql);
oci_bind_by_name($psql, ':ATT',$on2, -1, OCI_B_BLOB);
oci_execute($psql,OCI_DEFAULT);
$on2->save($data);
}
//echo "<Script language=\"JavaScript\">window.location.replace('".$SCRIPT_NAME."?LEID=$LEID&TeamID=$TeamID');</SCRIPT>";
} // end Save
?>
งงครับไม่รู้ว่าผิดตรงไหน ช่วยดูให้หน่อยครับ
|
|
|
|
|
Date :
2009-05-07 18:03:08 |
By :
evening |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|