Page 1 of 1

[SOVLED] echo results

Posted: Fri Jun 04, 2004 9:32 am
by wystan
I'm trying to echo results in a table, showing 3 results per line

something looking like

select id from table

1 | 2 | 3
4 | 5 | 6

Posted: Fri Jun 04, 2004 9:34 am
by Joe
use LIMIT 3. So a query would look like:

SELECT * FROM table LIMIT 3

Posted: Fri Jun 04, 2004 9:47 am
by Wayne
use LIMIT 3. So a query would look like:

SELECT * FROM table LIMIT 3
... is not a good idea, that would mean you would have to run a seperate query for every row of the table.
you are going to need to use some php coding to get this done, so maybe if one of the moderators would be kind enough to move this to the correct section!

to start you in the right direction though try looking at WHILE loops for example, Im sure if you search the site you will find an example thats already been posted.

Posted: Fri Jun 04, 2004 10:06 am
by Joe
My apologies I never realised that the user in question was asking for several 3row results. I only thought 1 row. Anyway good luck pal!

Posted: Fri Jun 04, 2004 10:27 am
by wystan
i got it to work with 2 while loops

Posted: Fri Jun 04, 2004 10:52 am
by Joe
Congradulations pal. Happy coding!