Europus wrote:
Actually, it doesn't exactly iterate the 1st row 4 times, it's a bit
more convoluted.
The table as 4 columns:
1 - int, primary, auto-incrementer
2 - varchar() values
3 - varchar() values
4 - varchar() values
and 2100 rows. The return is 4 rows of this:
array(4) {
[0]=> string(11) "col_1_row_1_data" ["col_1"]=> string(11)
"col_1_row_1_data"
[1]=> string(13) "col_2_row_1_data" ["col_2"]=> string(13)
"col_2_row_1_data" }
This is way beyond my ken, but I want to learn so I'll keep plugging
at it. Tips & suggestions are welcome....
Ulex
Yes well looking at the starting code i realise i forgot something.
Sorry for that.
When doing mysql_fetch_array or mysql_fetch_row you get only one row.
So what you want to do is loop through the result set:
$result = mysql_query($sql);
//loop through to display results
while ($row = mysql_fetch_array($result)) {
var_dump($row);
echo "<br /><br />";
}
P.s. Please reply to the list also :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php