我需要检查记录是0还是更高/当前时间相等。为此IN没有用,有人有想法吗?
这是我的SQL:
$sql = "SELECT * FROM domains WHERE tld='dk' AND whoisexpire !='' AND (whoisupdate='0' OR whoisupdate>='".time()."') AND majrefd>=25 AND majtf>=10 ORDER BY whoisexpire LIMIT 25";
更新了SQL行(删除了整数值周围的引号)
SELECT * FROM domains WHERE tld='dk' AND whoisexpire !='' AND (whoisupdate=0 OR whoisupdate>=".time().") AND majrefd>=25 AND majtf>=10 ORDER BY whoisexpire LIMIT 25
为了澄清一些问题,问题在于它不断返回相同的域,即使记录与SQL OR whoisupdate>=".time()."
不匹配
答案 0 :(得分:0)
这个怎么样?
$sql = "SELECT * FROM domains
WHERE tld='dk'
AND whoisexpire !=''
AND (whoisupdate = 0 OR whoisupdate >= NOW())
AND majrefd>=25
AND majtf>=10
ORDER BY whoisexpire
LIMIT 25";