Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Displaying results across pages
Old 05-22-2009, 08:42 AM Displaying results across pages
Skilled Talker

Posts: 60
Trades: 0
I've bought a script for my shop, but it list's the first page and then nothing else. I can't find out how to see the rest of the results on other pages. At the moment the code is:
PHP Code:
<?
$datecheck
=date("Y-m-d H:i:s");
$feature_sql="select * from shop where  picture1!='' and (expire_date > '$datecheck') order by expire_date limit 0, 10";
    
$feature_res=mysql_query($feature_sql);
    
$tot_count=mysql_num_rows($feature_res);
    
$count=0;
    if(
$tot_count 0)
    {
     
?>
at the top of the page. Then just before the results are displayed is:
PHP Code:
    <?
$l
=1;
        while(
$feature_row=mysql_fetch_array($feature_res))
    {
    
$string_1=$feature_row[product_descrip];
$i=$feature_row['id'];
    
?>
<? 
if(($l==1)||($l==3))
{
echo 
"<tr>";
}
?>
and finally at the bottom is:
PHP Code:
<?
$l
++;

 if((
$l==1)||($l==3))
{
echo 
"<tr>";
$l=1;
}
$allpro2 $feature_row['id'];


$allpro1 "$allpro2";

if(
$allpro!=""){
$allpro "$allpro1|$allpro";
}
if(
$allpro==""){
$allpro "$allpro1";
}
?>
<?
}
$allpro3 "$allpro";
    
?>
    <?
    
}
    
?>
I'm very new to php so don't even know if the code to have multiple pages is there already. At the bottom of the page I want to display a series of numbers so that people can go to which ever page they want and I want those numbers to be controlled dynamically so I don't need to create multiple pages for each of the shops categories.

Thanks
thehappyappy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-23-2009, 04:01 PM Re: Displaying results across pages
Extreme Talker

Posts: 181
Name: David Jackson
Trades: 0
what you want is called Pagination

I would advise that you learn php then you wont have to pay for scripts

Sitepoint has a nice tutorial

http://www.sitepoint.com/article/per...hp-pagination/

but if you need a hand with PHP drop me a PM
__________________

Please login or register to view this content. Registration is FREE
davidj is offline
Reply With Quote
View Public Profile
 
Old 05-26-2009, 05:25 AM Re: Displaying results across pages
Skilled Talker

Posts: 60
Trades: 0
Great thanks - I'll have a look at that
thehappyappy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Displaying results across pages
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11695 seconds with 12 queries