php paging

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
prasaderandi
Forum Newbie
Posts: 10
Joined: Fri Jul 01, 2005 1:09 pm

php paging

Post by prasaderandi »

i wrote a php coding but its not working if i'm using where
clause can you help me whats wrong
function coding is function pc_print_link($inactive,$text,$offset='')
{
if($inactive)
{
printf('<font color="#666666">%s</font>',$text);
}
else
{
printf('<a href="%s?offset=%d">%s</a>',$_SERVER['PHP_SELF'],$offset,$text);
}
}// end of function


function pc_indexed_links($total,$offset,$perpage)
{
$separator='|';
//print prev link

pc_print_link($offset==1,'<<Prev',$offset-$perpage);
//print all groupings except last one
for($start=1,$end=$perpage;$end<$total;$start+=$perpage,$end+=$perpage)
{

print $separator;
pc_print_link($offset==$start,"$start-$end",$start);

}
//end for loop
$end=($total > $start)?"-$total":'';
print $separator;
pc_print_link($offset==$start,"$start$end",$start);
//print next >> link
print $separator;


pc_print_link($offset==$start,'Next>>',$offset+$perpage);

}


my sql statement is
select * from friend where (age=$age and sex='$seek') order by username limit $offset1,$perpage";
but if i remove where clause its working proprly. help me
Sphen001
Forum Contributor
Posts: 107
Joined: Thu Mar 10, 2005 12:24 pm
Location: Land of the Beaver

Post by Sphen001 »

Hi,

If you need to change something in your post, please try and use the edit button instead of creating a new topic. :D

Sphen001
prasaderandi
Forum Newbie
Posts: 10
Joined: Fri Jul 01, 2005 1:09 pm

sorry

Post by prasaderandi »

sorry i'm new to ure site its never happen again
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

DO NOT CROSS POST.
Topic Locked.
Locked