In the past I have put the values in an array like this
- select whatever you need from the database
- then use the following after your select statement
session_register('Array');
$check_sql= mysql_num_rows($sql);
if($check_sql > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val){
$$key = stripslashes($val);
}
session_register('Item');
$Array[] = $Item; //puts next value into array
}//end while
this puts whatever you are getting from the database into an array ($Array)
3.You can use foreach to print out the array or just a for loop, whatever you are comfortable with
If you use a for loop get the size of the array
like this :
$SizeofArray = count($Array);
then do the for loop
set up the table
echo "<table>";
echo "<tr>";
for($i=0; $i<$SizeofArray; $i++){
echo "<td>";
echo $Array[$i];
echo "</td>";
}
echo </tr>
echo </table>
And that is one way you could do it.