|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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
|
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
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
|
|
#4
|
||||
|
||||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Database Development > Listing Items from a database into columns & Rows |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|