即時嘗試選擇全部並跳過某一行。如何從表中選擇所有,並跳過某個值的某一行
這行有一些語法錯誤,我不知道我做錯了什麼。
SELECT * FROM ads WHERE bbookschool like '$data' && WHERE bbookname != 'TEST' ORDER BY time desc
更多的代碼
$data = preg_replace ('#[^a-zA-Z0.-_% ]#i', '', $_POST['data']);
$Result = mysql_query("SELECT * FROM ads WHERE bbookschool like '$data' && WHERE bbookname != 'TEST0160' ORDER BY time desc")
or die (mysql_error());
while($row = mysql_fetch_array($Result)){
require 'book_ad.php';
$adCondition = (!empty($row['bbookname'])) ? $ad : '';
echo $adCondition;
}
感謝。
在'&& WHERE bbookname!','刪除where' –