...

View Full Version : a different pagination but it does not run



zodehala
05-15-2008, 05:47 PM
why does this paginaiton not run ?


$link = mysql_connect("localhost","root","123");
$db = mysql_select_db("forum");
$q1 = mysql_query("SELECT * FROM user ORDER BY userid ASC LIMIT $limit");
$q2 = mysql_query("SELECT * FROM user");
$limit = "$v1,$v2";
$v1 = $v2 * $i;
$v2 = 30;

if($_POST['p'] = $i){
global $v1, $v2, $limit;
$q1 = mysql_query("SELECT * FROM user ORDER BY userid ASC LIMIT $limit");
while($row = mysql_fetch_array($q1)){
printf("%s <br/>" .$row[4]);
}
}

for($i=0; $i < mysql_num_rows($q2)/$v2; $i++){
echo '<a href="x.php?p='.$i.'" target="_self">' .$i. ' </a>';
}

derzok
05-15-2008, 06:40 PM
The first two queries would fail because $limit is defined after you query the database. Come to think of it, why ARE you querying the database? You don't appear to be doing anything with the results of those first two...

And you're defining $limit using two values that are not defined. Same with $v1.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum