时间:2021-07-01 10:21:17 帮助过:90人阅读
$sql = "SELECT author,tags,subject,tid,authorid,dateline,fid FROM threads ORDER BY dateline DESC LIMIT 10"
如果tags是空值,则跳过,该怎么改呢?
以下是我的php代码:,
$sql = "SELECT author,tags,subject,tid,authorid,dateline,fid FROM threads ORDER BY dateline DESC LIMIT 10"
如果tags是空值,则跳过,该怎么改呢?
如果空值是:NULL
则:
$sql = "SELECT author,tags,subject,tid,authorid,dateline,fid FROM threads WHERE tags IS NOT NULL ORDER BY dateline DESC LIMIT 10"
如果空值是:''
$sql = "SELECT author,tags,subject,tid,authorid,dateline,fid FROM threads WHERE tags !='' ORDER BY dateline DESC LIMIT 10"