<?php
$db=mysql_connect('localhost',"root","") or die('Could not connect !');
mysql_select_db("TEST",$db) or die('Could not find the database');
$query="select * from TABLE where 1";
$result = mysql_query($query);
$i=0;
while($row=mysql_fetch_row($result)) $array[$i++]=$row;
echo "<table border=1>";
for ($x=0;$x<count($array[0]);$x++){
echo"<tr>";
for ($y=0;$y<count($array);$y++){
echo"<td>".$array[$y][$x]."</td>";
}
echo"</tr>";
}
echo"</table>";
?>
|