Say I have got the following:
$sql_qry = "select col1,col2,col3 from mytable";
$sql_result = mysql_db_query("mydb",$sql_qry) || die(mysql_error());
..then I wanna output my stuff
while($result_array = mysql_fetch_array($sql_result)) {
...a bunch of output stuff here ...
}
This will allow me just to output my results one after the other.
Now, say I want to produce this in a tabular form with multiple <td>'s as:
<table>
<tr>
<td>
$result_array["col1"]
$result_array["col2"]
$result_array["col3"]
</td>
<td>
$result_array["col1"]
$result_array["col2"]
$result_array["col3"]
</td>
</tr>
</table>
How can I do this? If I use a loop construct like for() to loop through some mysql_num_rows(), and use $result_array = mysql_fetch_array($sql_result) in the second <td>, I get errors, the horrible T_&$$ errors.
Any help?