View Single Post
Old 09-13-2010, 09:12 PM   #2 (permalink)
Krik
The Contributor
 
Join Date: Feb 2009
Posts: 65
Thanks: 0
Krik is on a distinguished road
Default

I can't make heads or tales of how the tables you provided are constructed to give you an accurate query, but if you are looking to query 2 tables you usually use a LEFT JOIN.

PHP Code:
$sql "
    SELECT *
    FROM ew_inform
    LEFT JOIN ew_notifications on ew_notifications.authorid = ew_inform.authorid
    WHERE ew_inform.senddate != '" 
$todatdate "'
"

You have to join them on a common identifier.

Now I get the sense that you may be checking if one table doesn't have a particular "authorid" with today's date. If that is the case I believe 2 query will be needed.
Krik is offline  
Reply With Quote