Displaying info from MySQL in Columns

Hi there,

Now i have a bunch rows in a SQL Database that i want to have displayed in a table but each rows info must be displayed in a column, for example the rows has data like this:

1, 2, 3, 4, 5, 6, 7, 8, 9, 10

so, lets say there is 3 rows it should display it like this :

1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10

this is the code i have so far:


 $query  = "SELECT 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 FROM info ORDER BY id";
 $result = mysql_query($query) or die('Error : ' . mysql_error());

 $content = "<table>";

  //code goes here, i guess it will be some kind of foreach loop or something

 $content .= "</table>";

echo $content;

I guess it will be a foreach loop i guess, i know how to work with the while loop but then it creates a column below each other and not next to each other. Help Pleaseā€¦Thank u

First you use the while loop to load the mysql result set in a multi-dimensional array.
Then you use the foreach loop to loop through the array and display the data as you want to.

Thanks, but okay i tried this:



        $content .= '<table>';

        while($row = mysql_fetch_array($result, MYSQL_NUM))
	{
		foreach($row as $1 => $9)
		{
			$content .= "
			<tr><td>$1</td></tr>";
		}
	}
	
	$content .= '</table>';


but then it only displays the second row not this first one or the rest?