I found hard to distinguish what is the problem with this query:
it returns a correct ouput but when I changed something like this:Code:$today = gmdate('2007-06-27 01:42:28'); //this is hardcoded based from the result $expire = gmdate('Y-m-d H:i:s'); echo $today; $expire = gmdate('2007-06-27 23:59:59'); //this is hardcoded based from the result $expire = gmdate('Y-m-d 23:59:59'); echo $expire; $sql = "SELECT avatar_name FROM $table where avatar_group = 'Avatrian Central' AND dt_detection > '$today' AND dt_detection < '$expire' group by avatar_name"; $result1 = mysql_query($sql); $numofrows1 = mysql_num_rows($result1);
Code:$today = gmdate('Y-m-d H:i:s'); $expire = gmdate('Y-m-d 23:59:59'); $sql = "SELECT avatar_name FROM $table where avatar_group = 'Avatrian Central' AND dt_detection > '$today' AND dt_detection < '$expire' group by avatar_name"; $result1 = mysql_query($sql); $numofrows1 = mysql_num_rows($result1);
NOTE: The only difference is there gmdate parameters. Others are the same.
Can you explain to me...



Reply With Quote


