【发布时间】:2014-11-05 08:16:59
【问题描述】:
MySQL 错误:1064(您的 SQL 语法有错误;请查看与您的 MySQL 服务器版本相对应的手册,以了解在第 1 行的 ')' 附近使用的正确语法) 会话暂停。
$sql = "INSERT INTO ". GALLERY_MASTER
. "(gallery_title,gallery_code, gallery_images,gallerycat_id, gallery_description,gallery_status) "
. " VALUES ( "
. " '". $post['gallery_title'] . "', "
. " '". $post['gallery_code'] . "', "
. " '". $file . "', "
. " '". $post['gallery_cat_id'] . "', "
. " '". $post['gallery_description'] . "', "
. " '". $post['gallery_status'] . "', "
. " )";
无效的 SQL:
INSERT INTO
GALLERY_MASTER(gallery_title,gallery_code, gallery_images,gallerycat_id, gallery_description,gallery_status)
VALUES ( 'image1', '021', '201411050700381463949438_img3.jpg', '4', '', '1', )
【问题讨论】:
-
去掉 ) 之前的最后一个 )
-
@Niraj7878 在发布之前格式化代码,并将其适当地标记到您的 DBMS。