Re: [請益] sql指令出現parse error
單雙引號的問題解決了
但是要將資料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
討論串 (同標題文章)
完整討論串 (本文為第 2 之 3 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章