 |
ช่วยด้วยครับ ว่าด้วยเรื่อง error sql ดูยังไงก็หาไม่เจอ |
|
 |
|
|
 |
 |
|
Code (PHP)
// เก็บชื่อภาพลงฐานข้อมูล
$insertSQL = "INSERT INTO person (name,position,section,details,tel,mail,facebook,lines,image_name,) VALUES ('".$_POST["name"]."','".$_POST["position"]."','".$_POST["section"]."','".$_POST["details"]."','".$_POST["tel"]."','".$_POST["mail"]."','".$_POST["facebook"]."','".$_POST["lines"]."','".$image_name."')" ;
mysql_select_db($database_connection, $connection);
$Result1 = mysql_query($insertSQL, $connection) or die(mysql_error(). "<br />" . $insertSQL);
ขึ้น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 'lines,image_name,) VALUES ('hh','hh','hh','hhh','02355','[email protected]',' at line 1 แต่ผมหา error ไม่เจอครับ
Tag : PHP, MySQL, HTML/CSS
|
|
 |
 |
 |
 |
Date :
2015-07-10 10:56:44 |
By :
wearewho_555 |
View :
640 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
พอแก้แล้วก็ขึ้นแบบเดิมครับ
Code (PHP)
$insertSQL = "INSERT INTO person (name,position,section,details,tel,mail,facebook,lines,image_name) VALUES ('".$_POST["name"]."','".$_POST["position"]."','".$_POST["section"]."','".$_POST["details"]."','".$_POST["tel"]."','".$_POST["mail"]."','".$_POST["facebook"]."','".$_POST["lines"]."','".$image_name."')" ;
mysql_select_db($database_connection, $connection);
$Result1 = mysql_query($insertSQL, $connection) or die(mysql_error(). "<br />" . $insertSQL);
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 'lines,image_name) VALUES ('ggggg','ggggggg','ggggggg','gggggggg','000','[email protected]'' at line 1
|
 |
 |
 |
 |
Date :
2015-07-10 11:03:45 |
By :
wearewho_555 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
lines แก้เป็น `lines`
คำสงวน
Code (SQL)
INSERT INTO person (name,position,section,details,tel,mail,facebook,`lines`,image_name)
|
ประวัติการแก้ไข 2015-07-10 11:22:02
 |
 |
 |
 |
Date :
2015-07-10 11:21:38 |
By :
NewbiePHP |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ ได้แล้วๆ    
|
 |
 |
 |
 |
Date :
2015-07-10 11:30:55 |
By :
wearewho_555 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|