[請益] Warning: mysql_fetch_row()
大家好....小弟又來問笨問題了....
這次問題跟以前那個沒有任何關係....之前那個源碼存資料庫因為技術上的問題所以還是放棄了...
不過今天在練習嘗試讀取WordPress的資料庫取文章列表的時候,發生了一個問題
我的語法:
: SELECT * FROM wp_posts ORDER BY ID DESC LIMIT 0, 10 WHERE post_status=publish
選取wp_posts的資料表,用ID的值來降序排列,從第0條開始取10條記錄,限定post_status要是publish
但是PHP執行出來...
: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in 檔案路徑 on line 23
但是如果拿掉WHERE post_status=publish 就可以正常取值(但是會取到草稿)
然後直接丟phpMyAdmin的結果...
: #1064 - 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 'WHERE post_status = publish
請問這個是什麼問題呢?我的環境是AppServ 2.5.10
麻煩各位幫我看看....感謝!!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 112.104.55.91
※ 編輯: ids93216 來自: 112.104.55.91 (05/28 20:24)
→
05/28 22:08, , 1F
05/28 22:08, 1F
→
05/28 22:20, , 2F
05/28 22:20, 2F
→
05/28 22:40, , 3F
05/28 22:40, 3F
推
05/28 23:41, , 4F
05/28 23:41, 4F
→
05/29 00:01, , 5F
05/29 00:01, 5F
→
05/29 00:01, , 6F
05/29 00:01, 6F
→
05/29 00:30, , 7F
05/29 00:30, 7F
→
05/29 08:21, , 8F
05/29 08:21, 8F
→
05/29 18:03, , 9F
05/29 18:03, 9F