displaying array data in multiple columns

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dylan001
Forum Newbie
Posts: 16
Joined: Thu May 19, 2005 5:57 am

displaying array data in multiple columns

Post by dylan001 »

I have a column in a MySQL database

company 1
company 2
company 3
company 4
company 5
...

how can I call it from the database into three colums using php:

i.e.

company 1 company 2 company 3
company 4 company 5 ...

I have been used to using the while() to call up data from different columns but this doesnt work in this instance? Any ideas on a possible solution would be greatly appreciated.

PS sorry if this has been covered before - couldn't find what I was looking for in the search.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

viewtopic.php?t=51506

Edit: Yes, I agree... The search sucks.
dylan001
Forum Newbie
Posts: 16
Joined: Thu May 19, 2005 5:57 am

Post by dylan001 »

The thread helped a little although I have the same problem as the final post... I'm getting a blank page. I appear to be getting all of the line breaks but none of the data from the database?

Any suggestion would be great.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

If this is the case, make sure your field names are right. Echoing data that PHP doesn't recognize usually results in empty echos (when display_error is off, anyway).
Post Reply