[請益] Mysql查詢式
書上教材敘述如下:
$query_rs = "SELECT * FROM " .$_SESSION['Database'] .
" WHERE category = '" . $category . "' AND category_type = '" .
$category_type .
"' ORDER BY publishdate DESC";
可是繫結部份卻沒有顯示我的資料集(rs)
當我在查詢上輸入
SELECT * FROM $_SESSION['Database']時 出現錯誤訊息:
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 ['Database']
at line 1
然後輸入我其他的資料表,例如 bedspread 查詢後都有結果。
我想要拿我整個資料庫某些有特定欄位的資料(分屬不同資料表)
例如含有$category與$category_type的欄位
請問要如何做篩選呢?
感恩....<(_ _)>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.136.154.7
推
03/23 18:03, , 1F
03/23 18:03, 1F
→
03/23 18:06, , 2F
03/23 18:06, 2F
→
03/23 18:07, , 3F
03/23 18:07, 3F
→
03/23 20:59, , 4F
03/23 20:59, 4F
→
03/24 00:45, , 5F
03/24 00:45, 5F
→
03/24 13:26, , 6F
03/24 13:26, 6F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章