Hi, Can you spot the problems with the code below? I am trying to count how many instances of 'Yes' and 'No' in a column called 'opt_in_spe'
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource
PHP Code:$result = mysql_query("select sum(if(opt_in_spe='Yes',1,0)) as Yes, sum(if(opt_in_spe='No', 1, 0)) as No");
$optin = mysql_fetch_object($result);
echo "$optin->No";
echo "$optin->Yes";








Bookmarks