0
$query = mysql_query("SELECT * FROM chapter LEFT JOIN page ON chapter.chapterID=page.chapterID WHERE page.category AND chapter.category LIKE 'Novice' GROUP BY page.pageID,page.chapterID ")or die('Query failed');
我有以下查詢,但我也想添加以下WHERE chapter.lectureID=1
我怎麼可以這樣做。我想這:
$query = mysql_query("SELECT * FROM chapter LEFT JOIN page ON chapter.chapterID=page.chapterID WHERE chapter.lectureID=1,page.category AND chapter.category LIKE 'Novice' GROUP BY page.pageID,page.chapterID ")or die('Query failed');
但是查詢失敗。
你應該嘗試輸出'mysql_error()',它應該告訴你類似「你的語法錯誤在chapter.lectureID = 1,page.category和chapter.category'附近」。 – Alexander