ไม่รู้ผิดตรงไหนครับ.....INSERT INTO statement., SQL state 37000 in SQLExecDirect in
ไม่รู้ผิดตรงไหนครับ....
Code
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in C:\AppServ\www\drug\update.php on line 12
page1.php
----------------------------------------------------------------------------
Code (PHP)
<? include "check_user.php"?>
<? include "check.php"?>
<? include "head.php"?>
<!-- Çѹ·Õèä·Â -->
<?php>
$_month_name = array("01"=>"01", "02"=>"02", "03"=>"03",
"04"=>"04", "05"=>"05", "06"=>"06",
"07"=>"07", "08"=>"08", "09"=>"09",
"10"=>"10", "11"=>"11", "12"=>"12");
$vardate=date('Y-m-d');
$yy=date('Y');
$mm =date('m');$dd=date('d');
if ($dd<10){
$dd=substr($dd,1,2);
}
$date=$dd ."/".$_month_name[$mm]."/".$yy+= 543;
?>
<!-- --------------------------------------------------------------------------------------- -->
<body bgcolor="#0099FF">
<form name="screening" method="post" action="update.php"><!-- àÁ×èÍà¡Ô´ action ãËé update/save -->
<div align="center"></div>
<TABLE cellpadding="2" cellspacing="2" align="center" bgcolor="#FFFFFF" width="800" height="230" >
<TR height="20"><!-- ºÃ÷Ѵ0 »ÅèÍÂÇèÒ§ -->
<TR height="30"><center><!-- ºÃ÷Ѵ1 -->
<!-- ºÃ÷Ѵ1¿ÔÇ 1 --><TD><div align="left"><FONT SIZE="3" COLOR="" > ª×èÍ-Ê¡ØÅ : </FONT>
<INPUT TYPE="text" NAME="NAME" style="width :300px; height:40px; font-size:30px;color:#CC3300"
value="<?include "name_user.php"?>">
</div></TD>
</center></TR>
<TR height="30"><center><!-- ºÃ÷Ѵ2 -->
<!-- ºÃ÷Ѵ1¿ÔÇ 2 --><TD><div align="left"><FONT SIZE="3" COLOR=""> µÓáË¹è§ : </FONT>
<INPUT TYPE="text" NAME="POSITION"
style="width :250px; height:30px; font-size:18px; color:#003399" value="<?include "position_user.php"?>">
</div></TD>
<!-- ºÃ÷Ѵ1¿ÔÇ 3 --><TD><div align="left"><FONT SIZE="3" COLOR="">¡ÅØèÁ§Ò¹ : </FONT>
<INPUT TYPE="text" NAME="PART"
style="width :230px; height:30px; font-size:18px; color:#003399" value="<?include "part_user.php"?>">
</div></TD>
</center></TR>
<TR height="30"><center><!-- ºÃ÷Ѵ3 -->
<!-- ºÃ÷Ѵ2¿ÔÇ 2 --><TD><div align="left"><FONT SIZE="3" COLOR=""> Çѹ·Õè¢ÍÅÒ : </FONT>
<INPUT TYPE="text" NAME="Ldate1"
style="width :250px; height:30px; font-size:18px; color:#003399"value="<?=$date;?>">
</div></TD>
<!-- ºÃ÷Ѵ2¿ÔÇ 1 --><TD><div align="left"><FONT SIZE="3" COLOR="">»ÃÐàÀ·¡ÒÃÅÒ : </FONT>
<select name="LEAVETYPE" id="LEAVETYPE"
style="width :200px; height:30px; font-size:18px; color:#003399">
<option value="ÅÒ»èÇÂ">ÅÒ»èÇÂ</option>
<option value="ÅÒ¡Ô¨">ÅÒ¡Ô¨</option>
<option value="ÅҾѡÃé͹">ÅҾѡÃé͹</option>
<option value="»ÃЪØÁ/ͺÃÁ">»ÃЪØÁ/ͺÃÁ</option>
<option value="OFF ´Ö¡">OFF ´Ö¡</option>
<option value="ÅÒ¤ÅÍ´">ÅÒ¤ÅÍ´</option>
<option value="ÅҺǪ">ÅҺǪ</option>
<option value="ÍÍ¡»¯ÔºÑµ þʵ. ÍØâÁ§¤ì">ÍÍ¡»¯ÔºÑµÔ þʵ.ÍØâÁ§¤ì</option>
</select>
</div></TD>
</center></TR>
</TABLE>
<TABLE cellpadding="1" cellspacing="1" align="center" bgcolor="#FFFFFF" width="800" height="50" >
<TR height="80"><center><!-- ºÃ÷Ѵ4 -->
<!-- ºÃ÷Ѵ2¿ÔÇ 3 --><TD><div align="left"><FONT SIZE="3" COLOR=""> ËÁÒÂà赯 : </FONT>
<INPUT TYPE="text" NAME="NOTE"
style="width :660px; height:60px; font-size:18px; color:#003399">
</div></TD>
</center></TR>
<TR height="20"><CENTER>
<TD>
<button name="USER" type="hidden" id="USER" value=" <?=$_SESSION["login_true"]?> " />
<input type="submit" name="button2" id="button2" value="ºÑ¹·Ö¡¢éÍÁÙÅ" />
<img src="img/Cute-Ball-Go-icon50.png" width="40" HEIGHT="40" /><B>ºÑ¹·Ö¡ÃÒ¡ÒÃ</B></button>
</CENTER></TD>
<TR height="10"><!-- ºÃ÷Ѵ0 »ÅèÍÂÇèÒ§ -->
</TABLE>
</body>
<? include "foot.php"?>
-------------------------------------------------------------------------------
update.php
Code (PHP)
<?
include "config.php";
$YEAR=$YEAR;
if($chk_hp!=1){
$LAMP_REFER=="";
}
if($usecar==""){
$usecar="No";
}
//$HOSP_REFER="$chk_hp";
$sql="INSERT INTO LEAVE (NAME,POSITION,PART,Ldate1,LEAVETYPE,NOTE)Values('$NAME','$POSITION','$PART','$Ldate1','$LEAVETYPE','$NOTE')";
$rs = odbc_exec($connect,$sql);
odbc_close($connect);
?>
Tag : PHP, Ms Access
Date :
2012-01-09 14:06:32
By :
มือใหม่
View :
1417
Reply :
1
Load balance : Server 03