|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Grabbing certain records in certain order
Hi, I am trying to figure out how to strip out records from my database in a way that is in order. For instance, column one of my table on the page will have products 1-5 while column two will have 6-10 and so on and so forth. But as you can see below my statement only takes into account all the records in the database. I need to break that up and whether its by having one statement do it all for each column or separate code for each column. As long as the result is what I am looking for. *Note I repeated the same product just to serve as an example of what I am trying to do. Thanks.
PHP Code:
|
|
#2
|
|||
|
|||
|
You could do something like this:
PHP Code:
I'd recommend that you put each DB column in a separate cell.
__________________
Sir, a desire of knowledge is the natural feeling of mankind; and every human being, whose mind is not debauched, will be willing to give all that he has to get knowledge. |
|
#3
|
|||
|
|||
|
What I had to do long ago when I had multiple columns like this was do a table inside a table type of thing so the output was something like:
Code:
<table>
<tr>
<td>
<table>
<tr>
<td>Item 1</td>
<td>Item 2</td>
<td>Item 3</td>
<td>Item 4</td>
<td>Item 5</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>Item 6</td>
<td>Item 7</td>
<td>Item 8</td>
<td>Item 9</td>
<td>Item 10</td>
</tr>
</table>
</td>
</tr>
</table>
|
|
#4
|
|||
|
|||
|
Quote:
I am not sure how to implement what you wrote. I think I understand the coding but how would the yield the result of putting different products in the columns? |
|
#5
|
|||
|
|||
|
PHP Code:
This should give you a table like this, each number is a product: 1 2 3 4 5 6 7 8 etc if you want to put each item in a separate cell, just use Llama's example |
|
#6
|
|||
|
|||
|
See above, but if you are looking for newspaper style columns, you'll have to check out:
http://www.w3.org/TR/css3-multicol/ Which seems to be the most efficient way of doing it. Gives you (in theory) (if you do 3 columns): 1 6 11 2 7 12 3 8 13 4 9 14 5 10 15 |
|
#7
|
|||
|
|||
|
your methods great. Now i understand thank you!!
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Grabbing certain records in certain order |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|