Never mind.

Status
Not open for further replies.
Need a little help with PHP.

I'm extracting data from a SQL database, and attempting to display a specific column in a certain way.

Currently, I have all the tools/knowledge to display my results in the following manner:

1
2
3
4
5
6

Instead, I'd like to be able to make a table to dynamically display those results as:

1 2
3 4
5 6

I'm completely stuck on how to do this. Can anyone offer any assistance?
 
For this, I've been previously using something similar to the following:
Code:
while ($row=mysql_fetch_array($results)) {
			print "$row[Category]<br>";
		}

An example I've received to fix the above problem is the following:
Code:
while ($row=mysql_fetch_array($results)) {
			extract($row);

           if ($x==0){
             print "</tr><tr>";
           }

           $x++;

           if ($x == 2){
             $x = 0;
           }

           print "<td>$row[Category]</td>";
		}
However, this doesn't seem to work properly.
 
Status
Not open for further replies.