以下代码将从我的数据库中存在的所有类别中获取所有最新项目。我想隐藏特定类别的所有项目,因此它不显示该特定类别的项目,但仍显示其他类别的项目。
$query="
SELECT t1 . *,
DATEDIFF( t1.date_added, '$curDate' ) as remaining,
at.auctions_type_name
FROM wp_mam_auctions AS t1
INNER JOIN wp_mam_auction_type AS at ON at.auctions_type_id = t1.auction_type_id
WHERE t1.auction_status_id = '1' AND t1.sold='0'
AND DATEDIFF( t1.date_added, '$curDate' ) <= '0'
AND DATEDIFF( t1.date_added, '$curDate' ) >= '-$new_listing_days'
AND TIMESTAMPDIFF(MINUTE , '$curDate', t1.date_expiry ) >'0'
ORDER BY date_added DESC LIMIT $from1, $max_results1
";