Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-15-2008, 05:47 PM   PM User | #1
zodehala
Regular Coder

 
Join Date: Dec 2007
Posts: 269
Thanks: 28
Thanked 0 Times in 0 Posts
zodehala can only hope to improve
a different pagination but it does not run

why does this paginaiton not run ?
PHP Code:
$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>';
    } 
zodehala is offline   Reply With Quote
Old 05-15-2008, 06:40 PM   PM User | #2
derzok
Regular Coder

 
Join Date: May 2008
Location: Ohio
Posts: 231
Thanks: 3
Thanked 21 Times in 21 Posts
derzok is an unknown quantity at this point
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.

Last edited by derzok; 05-15-2008 at 06:44 PM..
derzok is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:42 AM.


Advertisement
Log in to turn off these ads.