this script checks for a offset value in the url and then does one or the other depending on the existence of it, but it gives me an error in the two last lines.
anyone have any idea of what's wrong?
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\WINDOWS\Desktop\webserver\clphp\index.php on line 91
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\WINDOWS\Desktop\webserver\clphp\index.php on line 94
$limit=3;
list($name, $val) = each($HTTP_GET_VARS);
if ($name = 'offset') {
$high = $offset+$limit;
$result = mysql_query("SELECT * FROM `news` LIMIT $offset, $high");
} else {
$offset = 0;
$high = $limit;
$result = mysql_query("SELECT * FROM `news` LIMIT $offset, $high");
}
this is line 91 --> $numrows = mysql_num_rows($result);
this is line 94 --> while($myrow = mysql_fetch_array($result, MYSQL_ASSOC)) {