Hi PHP builder,
can someone explain to me how I determine if the return value from the query has something or not. In mysql table I have one entry with today date and it works if there a entry for today date but if there is none it just show a blank page. Is there a way to confirm that if it is NULL, or empty? Any suggestions would greatly appreciate.
Thank you.
$today=date('Y-m-d');
$con=mysql_connect("localhost", 'hung', 'hung123') or die(mysql_error());
mysql_select_db("molson") or die(mysql_error());
$result = mysql_query('SELECT * FROM timekeeping WHERE USERNAME="'.$username.'" and DATE="'.$today.'"');
while($row = mysql_fetch_array( $result ))
{
if ($row['MATTERID']==NULL)
echo "nothing";
else
echo $row['MATTERID'];
}