Re: [請益] 無法存到資料庫

看板PHP作者 (想.....似塵埃)時間17年前 (2008/05/07 11:20), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串6/7 (看更多)
※ 引述《liwi ()》之銘言: : $sql = "UPDATE firm SET name_chinese='$name_chinese', boss='$boss', : contact='$contact', email='$email', phone='$phone', fax='$fax', : address1='$address1', address2='$address2', website='$website', : year_founded='$year_founded', stock='$stock', stockstatus='$stockstatus', : stock_year1='$stock_year1', stock_year2='$stock_year2' WHERE : firm_id='$firm_id'"; 字串跟變數要接在一起要用 "字串".$變數."字串" "字串='變數'"是沒有用的 他只會抓到變數的名稱 而不是值 欄位名稱在sql語法裡建議加上`` 變成 `欄位名稱` 以防用到了保留字而判別不出來 : mysql_query($sql, $link_ID); : 資料庫那邊也設好了 : 到底是哪裡出了問題 : 我記得有檢測這個變數是否有傳回資料到資料庫的指令 : acho什麼的 用echo 打echo $sql; 就可以知道那段語法呈現的結果為何 : 感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.124.3.6 ※ 編輯: maplenote 來自: 59.124.3.6 (05/07 11:22)

05/07 11:22, , 1F
我還以為兩篇一樣 ...
05/07 11:22, 1F

05/07 11:37, , 2F
太快按 end 嗎 XD
05/07 11:37, 2F
文章代碼(AID): #188H_XII (PHP)
討論串 (同標題文章)
文章代碼(AID): #188H_XII (PHP)