dimanche 24 mai 2015

My query keeps returning 'Resource id #3' when it needs to return 0

So basically what I am trying to do is check whether an email address was entered in the User_Email column within the 1 minute. If it has I want to echo something, if not I want to do something else.

However, I now echoed the query and I realized it keeps returning 3. When it needs to return 0 (cause a minute has passed, since the last entry).

$db_check_usage_date_time = mysql_query("SELECT User_Email FROM User_Data WHERE ADDTIME(Usage_Date, Usage_Time) >= date_sub(NOW(), INTERVAL 1 MINUTE)");

    if (mysql_num_rows($db_check_usage_date_time) > 0) {
        echo 'USED IN THE LAST HOUR' .$db_check_usage_date_time;
    }else {

What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire