Jump to content

Select Count Error?


Zepo.

Recommended Posts

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]";

Link to comment
https://forums.phpfreaks.com/topic/118049-select-count-error/
Share on other sites

$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!

Link to comment
https://forums.phpfreaks.com/topic/118049-select-count-error/#findComment-607289
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.