Zepo. Posted August 4, 2008 Share Posted August 4, 2008 This seems to completely ignore the left join. $total=mysql_query("SELECT COUNT(*) FROM `mybb_offers` a LEFT JOIN mybb_offerscompleted c ON a.ID = c.ID AND userid='$user_row[uid]' WHERE a.`cat` = '$cat' AND `MID` = 'no' AND c.ID IS NULL "); $total=mysql_fetch_array($total); $total="$total[0]"; Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 4, 2008 Share Posted August 4, 2008 $total=mysql_query("SELECT COUNT(*) FROM `mybb_offers` a LEFT JOIN mybb_offerscompleted c ON a.ID = c.ID AND userid='$user_row[uid]' WHERE a.`cat` = '$cat' AND `MID` = 'no' AND c.ID IS NULL ") or die(mysql_error()); // <----- add me! Quote Link to comment Share on other sites More sharing options...
Zepo. Posted August 4, 2008 Author Share Posted August 4, 2008 It does not display any errors. Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 4, 2008 Share Posted August 4, 2008 I don't think your data is what you are expecting, based on that query. Try putting the "userid='$user_row[uid]'" part in the WHERE clause. Quote Link to comment Share on other sites More sharing options...
Zepo. Posted August 4, 2008 Author Share Posted August 4, 2008 Well the thing is it works on a loop i have on anouther page. What i'm trying to do is leave out all the entrees with the id that matches the id in anouther table with the same userid. Quote Link to comment Share on other sites More sharing options...
ainoy31 Posted August 4, 2008 Share Posted August 4, 2008 wouldn't you need to use an alias for the userid and MID as well? Quote Link to comment Share on other sites More sharing options...
Zepo. Posted August 4, 2008 Author Share Posted August 4, 2008 wouldn't you need to use an alias for the userid and MID as well? I don't believe so. Quote Link to comment Share on other sites More sharing options...
Zepo. Posted August 5, 2008 Author Share Posted August 5, 2008 Anyone? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.