jwknz
jwknz

Reputation: 6814

PHP MYSQL - combining 2 while loops

I want to populate a table form a MYSQL database.

I have defined the tables and the mysql_query's so that this should be a lot cleaner.

Separately I am able to get the results, but I need to combine them since I am making a 4 column table.

looks like this:

-------------------------------------------------------------
|              |              |              |              |
| Menu 01 info | Menu 01 info | Menu 06 info | Menu 06 info |
|              |              |              |              |
-------------------------------------------------------------


while ($menu01 = mysql_fetch_array($order01)) AND while ($menu06 = mysql_fetch_array($order06)) 
{

  //TableStuff

It is the line with while that I need to be without errors. Any help would be great. PHP is not my strongest point of knowledge sorry:-)

Upvotes: 1

Views: 1178

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798526

Boolean and, and mind the grouping.

while (($menu01 = mysql_fetch_array($order01)) && ($menu06 = mysql_fetch_array($order06)))

Upvotes: 3

Related Questions