I have this MySQL query that has to run when the page is loaded, however not all users have the data required to return anything, this gives out a massive error.
Is there anyway i can handle this error so when the query doesn't return anything, i can just return say "0" in the function. Here is the code;
function getTimesUp($email) {
$query1 = mysql_query("SELECT uptime FROM info WHERE user='$email'");
$uptime1 = mysql_result($query1, 0);
return $uptime1;
}
Thanks!