ช่วยที่ มันขึ้น error เเบบนี้อ่ะ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
Code (PHP)
<FORM ACTION="mysqlupdate_c_money.php?id=<?=$_GET["id"];?>" method="post" class="style2" onSubmit="JavaScript:return fncSubmit();">
<?
include('connect.php');
$objQuery = mysql_query("SELECT * FROM c_money WHERE id = '".$_GET["id"]."' ");
?>
<div id="tb_1">
<table width="1249" border="1" cellspacing="0" align="center" height="120">
<tr bgcolor="#FFCC99">
<td width="184" height="33" bgcolor="#FFb173" rowspan="2"><div align="center" class="style30"><strong>ฝ่ายกลุ่มสาระ/งาน</strong></div></td>
<td width="192" height="33" bgcolor="#FFb173" rowspan="2"><div align="center" class="style30"><strong>โครงการ/งาน/กิจกรรม</strong></div></td>
<td height="39" bgcolor="#FFb173" colspan="4"><div align="center" class="style30"><strong>งบประมาณที่ได้รับจัดสรร</strong></div></td>
<td height="39" colspan="2" align="center" bgcolor="#FFb173"><strong>งบที่ใช้ทั่วไป</strong></td>
<td width="66" height="39" rowspan="2" align="center" bgcolor="#FFb173"><strong>งบที่เหลือ</strong></td>
<td width="85" height="39" rowspan="2" align="center" bgcolor="#FFb173"><strong>งบที่ใช้ไป</strong></td>
<td width="85" height="39" rowspan="2" align="center" bgcolor="#FFb173"><strong>ยืนยัน</strong></td>
</tr>
<tr>
<td width="81" height="35" align="center" bgcolor="#FFCCCC"><strong>รายหัว </strong>
<td width="106" align="center" bgcolor="#FFCCCC"><strong>เรียนฟรี 15 ปี</strong></td>
<td width="117" align="center" bgcolor="#FFCCCC"><strong>ระดมทรัพยากร</strong></td>
<td width="81" align="center" bgcolor="#FFCCCC"><strong>อื่นๆ</strong></td>
<td width="138" align="center" bgcolor="#FFCCCC"><strong>วัน/เดือน/ปี</strong></td>
<td width="68" align="center" bgcolor="#FFCCCC"><strong>จำนวนเงิน</strong></td>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr bgcolor="#CCFFFF">
<div id="">
<td height="44"><div align="center" width="20" height=" 20" >
<div align="center">
<input type='text' name="group" value="<?=$objResult["group"];?>" size="26">
</div>
</div></td>
<td><div align="center" width="20" height=" 20">
<input type='text' name="activities" value="<?=$objResult["activities"];?>" size="26">
</div></td>
<td><div align="center">
<input type='text' name="b_headcount" value="<?=$objResult["b_headcount"];?>" onkeyup="calculate()" id='input_calculate' size="9">
</div></td>
<td><div align="left" width="20" height=" 20">
<div align="center">
<input name="b_study_free" type='text' id='input_calculate' onkeyup="calculate()" value="<?=$objResult["b_study_free"];?>" size="11">
</div>
</div></td>
<td><div align="left" width="20" height=" 20">
<div align="center">
<input name="amount" type='text' id='result_calculate' value="<?=$objResult["amount"];?>" size="12">
</div>
</div></td>
<td><div align="left" width="20" height=" 20">
<div align="center">
<input name="b_other" type='text' id='input_calculate' onkeyup="calculate()" value="<?=$objResult["b_other"];?>" size="9">
</div>
</div></td>
<td><div align="left" width="20" height=" 20">
<div align="left">
<input name="dd" type='text' value="<?=$objResult["dd"];?>" size="1" />
/
<input name="mm" type='text' value="<?=$objResult["mm"];?>" size="1" />
/
<input name="dd" type='text' value="<?=$objResult["yy"];?>" size="2" />
</div>
</div></td>
<td><div align="left" width="20" height=" 20">
<div align="center">
<input name="result_calculate" type='text' id='result_calculate2' value="<?=$objResult["amount"];?>" size="9" />
<script type='text/javascript'>calculate()</script>
</div>
</div></td>
<td><div align="left" width="20" height=" 20">
<div align="center">
<input name="remaining_stm" type='text' value="<?=$objResult["remaining_stm"];?>" size="11" />
</div>
</div></td>
<td><div align="left" width="20" height=" 20">
<div align="center">
<input name="Statements_au" type='text' value="<?=$objResult["Statements_au"];?>" size="11"/>
</div>
</div></td>
<td width="85"><div align="center" height=" 20" >
<div>
<div align="center">
<button id="submit" name="submit"><img src="images/submit.png"></button>
</div>
</div></td>
</div>
</tr>
<?
}
?>
</table>
<?
mysql_close($objConnect);
?>
</span></div>
</form>
หน้า mysqlupdate_c_money.php
Code (PHP)
<?
include("connect.php");
$strSQL = mysql_query("UPDATE c_money SET group='".$_POST["group"]."',activities='".$_POST["activities"]."', b_headcount='".$_POST["b_headcount"]."',b_study_free='".$_POST["b_study_free"]."', b_resources_m='".$_POST["b_resources_m"]."',b_other='".$_POST["b_other"]."',dd='".$_POST["dd"]."', mm='".$_POST["mm"]."',yy='".$_POST["yy"]."',amount='".$_POST["amount"]."', remaining_stm='".$_POST["remaining_stm"]."',Statements_au='".$_POST["Statements_au"]."' WHERE id='".$_GET["id"]."' ") or die(mysql_error());
if($strSQL){
echo"<script>";
echo"alert('เเก้ไขข้อมูลเรียบร้อยเเล้ว');";
echo"location.href='c_money.php?id=".$_GET["id"]."';";
echo"</script>";
exit("");
}else{
echo "error";
}
mysql_close($objConnect);
?>
Tag : PHP, HTML/CSS, JavaScript, CakePHP
Date :
2012-08-29 11:21:02
By :
เกียวซ่า
View :
1469
Reply :
1
Load balance : Server 03