Hey everyone! :)
I have a line of code that I am not sure about and I get an error message that says,
"Fatal error: Call to undefined function mysql_results() in C:\Program Files (x86)\EasyPHP-5.3.8.1\www\test5\func\blog.php on line 33"
when the code is from here in this script:
blog.php
<?php
function add_post($title, $contents, $category) {
}
function edit_post($id, $title, $contents, $category){
}
function add_category($name){
$name = mysql_real_escape_string($name);
mysql_query("INSERT INTO 'categories' SET 'name' = '$name'");
}
function delete($field, $id){
}
function get_posts($id = null, $cat_id = null){
}
function get_categories($id = null){
}
function category_exists($name){
$name = mysql_real_escape_string($name);
$query = mysql_query("SELECT COUNT(1) FROM `categories` WHERE `name` = `$name`");
return ( mysql_results($query, 0) == 0 ) ? false : true;
}
the code that is in question is here:
return ( mysql_results($query, 0) == 0 ) ? false : true;
any help would be greatly appreciated! :) Thanks!