看板 PHP 關於我們 聯絡資訊
以下是小弟撰寫的程式 我想把下面 $filename $image $ exifname 寫入資料庫裡 不知道為什麼就是無法寫入請問我的程式哪裡出錯了 因為對SQL不太了解 請高手不吝指教 謝謝!! foreach($files as $file){ $title =Title($file); //Title 自訂函式 $filename="檔案夾:[".$dd."]-檔名:[".$file."]; $image="<img src='$dd"."{$file}' alt=".$file.">"; $exifname=showEXIF($dd."/".$file); //showEXIF 自訂函式 } mysql_connect("localhost","root","123")or die("not link"); mysql_select_db("project"); $sql="insert 'list'('filename','image','exifname') values('$filename',$image','exifname')"; mysql_guery($sql); //$dd 放置目錄路徑 $file檔案 //目錄下都放置圖片 //資料庫// 資料庫project 資料表exif 資料欄位 型態 filename varchar(100) image longblob exifname mediumtext -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.120.76.123
alpe:錯誤訊息勒? 08/31 11:49
yanli2:因為你用guery 啊 08/31 12:29
tzungshium:沒有錯誤訊息產生 guery 是我參考書上寫的有問題嗎?? 08/31 12:31
yanli2:mysql_query. 我想.這樣的話你的問題應該不只一個了 08/31 12:32
gckenny:guery ?! query ?! 傻傻分不清楚...XD 打錯是很恐怖的事 08/31 12:33
tzungshium:我把Q看成G了 ^^ 請問該怎樣才能知道資料有沒有寫入 08/31 13:44
yanli2:看資料庫裡有沒有那個資料呀 你也可以用phpmyadmin簡單些 08/31 13:52
alpe:mysql_query(.,.) or die( mysql_error() ); 08/31 14:11
tzungshium:check the mamual that corresponds to your MySQL 08/31 14:20
tzungshium:server version for the right syntax to use near 08/31 14:20
tzungshium:'UPLOAD/test.JPG' alt=test.JPG>' 這是錯誤訊息 08/31 14:21
tzungshium:我有用phpmyadmin再看資料庫 資料表裡面就是沒有寫入 08/31 14:23