Re: [請益] 不知道錯再哪....麻煩看角@下

看板PHP作者 (Powered by Zend Engine2)時間18年前 (2007/07/24 15:58), 編輯推噓3(300)
留言3則, 3人參與, 最新討論串2/2 (看更多)
※ 引述《p3013220132 (小豬)》之銘言: : $insertSQL = sprintf("INSERT INTO member (username, password, name, sex, birthday, email, phone, address, uniform, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", ^^^^^ '%s' : GetSQLValueString($_POST['username'], "text"), : GetSQLValueString($_POST['password'], "text"), : GetSQLValueString($_POST['name'], "text"), : GetSQLValueString($_POST['sex'], "text"), : GetSQLValueString($_POST['birthday'], "date"), : GetSQLValueString($_POST['email'], "text"), : GetSQLValueString($_POST['phone'], "text"), : GetSQLValueString($_POST['address'], "text"), : GetSQLValueString($_POST['uniform'], "text"), : GetSQLValueString($_POST['1'], "text"), : GetSQLValueString($_POST['2'], "text"), : GetSQLValueString($_POST['3'], "text"), : GetSQLValueString($_POST['4'], "text"), : GetSQLValueString($_POST['5'], "text"), : GetSQLValueString($_POST['6'], "text"), : GetSQLValueString($_POST['7'], "text"), : GetSQLValueString($_POST['8'], "text"), : GetSQLValueString($_POST['9'], "text"), : GetSQLValueString($_POST['10'], "text")); : 錯誤訊息 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 '1, 2, 3, 4, 5, 6, 7, 8, 9, 10) VALUES ('12312312', '12312321', ' -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.253.33

07/24 16:03, , 1F
不懂!!!可以詳細說明嗎
07/24 16:03, 1F

07/24 16:13, , 2F
他應該是要跟你強調 '%s'
07/24 16:13, 2F

07/24 20:45, , 3F
%s 左右兩邊要有單引號 '
07/24 20:45, 3F
文章代碼(AID): #16fR4ACW (PHP)
文章代碼(AID): #16fR4ACW (PHP)