Re: [請益] sql指令出現parse error

看板PHP作者 (sh~~)時間18年前 (2007/08/25 12:21), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串2/3 (看更多)
單雙引號的問題解決了 但是要將資料Insert進資料表欄位卻沒辦法Insert進去 哪裡出了問題呢?? 資料表account_pwd 欄位 id(附加:auto_increment) account department 資料表volleyball 欄位 userid name department 以下的程式是不同id或account會對應到不同department $sql = "SELECT * FROM account_pwd Where id='$id' "; $result = mysql_query($sql, $link); if (!$result) die("執行 SQL 命令失敗"); while ($row = mysql_fetch_array($result)) { $sql1 = "INSERT INTO volleyball (department) VALUES ('".$row["department"]."')"; $result1 = mysql_query($sql1, $link); } mysql_free_result($result); mysql_close($link); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ※ 編輯: nbaby19 來自: 203.64.183.208 (08/25 12:23)

08/25 14:28, , 1F
阿 我自己改出來了 = =||
08/25 14:28, 1F
文章代碼(AID): #16pwvMl7 (PHP)
文章代碼(AID): #16pwvMl7 (PHP)