mysql max() question

wxdqz

New Member
Perhaps someone can take a peek at this function and tell me what I'm missing. When I run the query through phpmyadmin, I get the proper result, however the function via php is not returning anything.

Hopefully you can see what I am missing. Your advice will be greatly appreciated.

Thanks,

Andrew



function get_next_site_id()
{
$conn = db_connect();
$query = "select max(site_id) as max from tblSite";
$result = @mysql_query($query);

if (!$result)
return false;
else {
if ($result["max"]=="")
return "0";
else
return $result["max"];
}
}
 
Back
Top