mysql - PHP if with an array SQL -



mysql - PHP if with an array SQL -

i've got problem here

$resultcontlog = mysql_query("select count(*) dailylogs data_log > now() - interval 30 min , server_id_log=".$fid.";"); $adata = mysql_fetch_assoc($resultcontlog); if ($adata > 0) { echo 'ok'; } else { echo 'not ok'; }

my php function returns number of rows; did include new logs if happen later 10 minutes. if ($adata > 0) statement doesn't work properly. can guys help me, please?

to check , utilize this

your need check count column getting query if grater zero, here used alias of "total"

$resultcontlog=mysql_query("select count(*) total dailylogs data_log > now() - interval 30 min , server_id_log=".$fid.";"); $adata=mysql_fetch_assoc($resultcontlog); if($adata['total']) { echo 'ok'; } else { echo 'not ok'; }

php mysql arrays

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -