Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community 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 April 6th, 2004, 02:46 AM
halfdogg halfdogg is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 23 halfdogg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 2 sec
Reputation Power: 0
Question Listing Items from a database into columns & Rows

Hi all. I'm building a shopping cart and i could like to list items from a database depending on category..so when you go 2 a particular category you get a list of the items displayed i.e picture, short description and price. I would like the items to be listed into three columns but the rows shall depend on the number of items in the category. could someone please help me with the code? Thanks in advance

Reply With Quote
  #2  
Old April 6th, 2004, 03:09 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Assuming this is for ASP:
You'd have an ASP script which would request a querystring value (The Cat ID). This ID would then be used in an SQL query, which returns a recordset. You'd then loop through the recordset, display the items belonging to that category.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old April 6th, 2004, 04:17 AM
halfdogg halfdogg is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 23 halfdogg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 2 sec
Reputation Power: 0
Yeah i'm using asp and for the listing i can do that but i want the list to form columns on their own therefore filling rows upto the last item. thank you

Reply With Quote
  #4  
Old April 6th, 2004, 04:36 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Inside your recordset loop, create another loop that goes from 1 to X (X being the number of columns - 3 in your case)
When X is reached, start a new row.
If you run out of records mid row, create empty col's until you hit X

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > Listing Items from a database into columns & Rows


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 5 hosted by Hostway