Re: Select sum(x) >0 with multiple columns
Whoops, that's right felix, good spot! Seems like the SUM(IF(S1=0,NULL,S1) solution does the job after all.
So, gaute, you probably did execute the mysql_query, but did not test if it returned a valid result resource. You can tell, because an invalid query will return a FALSE resource. In the php examples they do something like:
// Perform Query
$result = mysql_query($sql);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
//process as usual