Hey guys,
I don't see anything wrong in the function but mysql_result is complaining about the parameter value passed to it.
function question_exists($question_id){
$question_id = (int)$question_id;
return ( mysql_result(mysql_query("SELECT COUNT('id') from `posts` WHERE `id`=$question_id"),0) == 0) ? false : true;
// if the question doesn't exist (equal to ZERO) then return false. Else, return true
}
$id = '20';
question_exists($id) => this gives me this message "Warning: mysql_result() expects parameter 1 to be resource, boolean given "
Thanks in advance for the help!