<?php
class Page {
function getPage($urlOfPage){
$result = mysql_query('SELECT category, title FROM rs-planet WHERE url = "'. mysql_real_escape_string($urlOfPage));
if(mysql_num_rows($result) === 0){
header('HTTP/1.0 404 Not Found');
exit;
}
else{
return $page[] = mysql_fetch_array($result);
}
}
}
?>
And I have this errors:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocss-planet\classes\page.php on line 6
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocss-planet\classes\page.php on line 11 And I don't see the problem...
And if I do var_dump @ $result I get a boolean. (If it's founded @ the db it gives true, if it isn't it gives me false.)
PS. Sorry for my bad English, my main language is Dutch.
EDIT: var_dump(mysql_error) =
string(152) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"index' at line 1"