我有两个表(table_a 和 table_b)与一个 UNION 相结合。
如何检查是否记录 ist table_a。
我试过这个,但不工作:
$res=mysql_query("(SELECT id, added FROM table_a WHERE user_id = '".$uid."')
UNION
(SELECT id as comments, added FROM table_b WHERE user_id = '".$uid."') ORDER BY added DESC LIMIT 50");
if(!empty($rows["comments"])) // not working