SunQuest
           PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 21st, 2002, 08:52 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
On-Line Catalog

Ok, got a question for the whizkids here. I have created a PHP page that reads a MySQL DB. It then produces a page of products, with images, descriptions and price. I have broken it down by catagory so only the right pieces land on their designated pages. However all said and done, I have 50 pieces on one page. How can I cut it off at say 10, and clicking "Continue" produces another page of 10.???

Reply With Quote
  #2  
Old May 21st, 2002, 09:01 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: On-Line Catalog

Check out this tutorial on previous and next links:

http://codewalkers.com/tutorials.php?show=4


Reply With Quote
  #3  
Old May 21st, 2002, 10:08 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: On-Line Catalog

Thanks a lot!!! I'm fairly new to this, and like it a lot. That was the fastest most helpful come back I've ever gotten. Thanks again,

Dean

Reply With Quote
  #4  
Old May 22nd, 2002, 08:43 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: On-Line Catalog

Ok most of it seems to be working... some trial and error, which makes me learn. However, as a test I put an echo $start at the end of your design, and it equaled zero. Where in the code does $start get set to 10, or another value? Also the url generated by $start+10 is
?start=0+10. Is that right? or is it supposed to be getting the value of that which is just 10? Again any help would be great...


Dean

Reply With Quote
  #5  
Old May 22nd, 2002, 09:17 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: On-Line Catalog

i'm not sure if this is what you're talking about.. but try adding something like the following..

php Code:
Original - php Code
  1.  
  2. if($start <= 0)
  3. {
  4.     $start = 1;
  5. }


is that what you're having a problem with?

Reply With Quote
  #6  
Old May 22nd, 2002, 09:22 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: On-Line Catalog

the url should be getting the value of that which would be 10...


Reply With Quote
  #7  
Old May 22nd, 2002, 09:32 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: On-Line Catalog

sorry i don't think i understand the question.

Reply With Quote
  #8  
Old May 22nd, 2002, 09:35 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: On-Line Catalog

if($numrows>($start+10)) $display_footer .= "<a href="$PHP_SELF?start=$start+=10">Next</a> $start" ;

Generates...

<a href="/hollywood.php3?start=0+=10">Next</a> 0

I've tried adding quotes, escaping characters... I'm at a loss. The final $start in my code is to test the value, which came up as you can see, after the link code as a zero.

How do I force it to add the $start and the 10?

Again all help is appreciated,

Dean

Reply With Quote
  #9  
Old May 22nd, 2002, 09:47 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: On-Line Catalog

how about..

php Code:
Original - php Code
  1.  
  2. if($numrows>($start+10))
  3. {
  4.     $start += 10;
  5.     $display_footer .= "<a href="$PHP_SELF?start=$start">Next</a> $start";
  6. }


????

Reply With Quote
  #10  
Old May 22nd, 2002, 09:59 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: On-Line Catalog

or even...

if($numrows>($start+10)) $display_footer .= "<a href="$PHP_SELF?start=" . $start+=10; . "">Next</a> $start";

hmm..

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > On-Line Catalog


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway