Jump to content

Help with count?


Mr Chris

Recommended Posts

Hi All,

 

I have a wierd problem with a count query:

 

<?php
      $SQL = mysql_query("SELECT sum(pictures_taken) as no_pics FROM event_data WHERE $the_query AND event_publication = '6' AND unix_timestamp(event_date) < unix_timestamp(NOW()) AND DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= event_date");
      $row = mysql_fetch_array($SQL);
      echo "".$row['no_pics']."\n"; 
?>

 

However, sometimes I get a value returned, but sometimes no value is returned.  It seems to have most difficulty when the Value returned from the count is 0.

 

Can anyone help?

Link to comment
https://forums.phpfreaks.com/topic/178712-help-with-count/
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.