02-07-2008, 04:06 AM
|
#1 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
MySQL Error with Pagination
When trying to perform a sql query with a normal pagination procedure, I get this error:
PHP Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in index.php on line 118
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 '-3' at line 1
// This is what the query looks like
$query = mysql_query("SELECT * FROM `news` LIMIT $limit ");
// Limit is this:
$limit = ($p - 1) * $max;
// $p = $_GET['p'] and $max = 3;
Please help! :(
__________________
VillageIdiot can have my babbies ;d
|
|
|
|