11-11-2010, 02:27 PM
|
#2 (permalink)
|
|
The Addict
Join Date: Aug 2008
Posts: 336
Thanks: 8
|
mysql_fetch_array only returns the first row of the result and then moves the internal data pointer ahead. The array has 2 entries because 1 is for the numeric indexed array and the other one is for the associative array. what you can do is replace this:
to this
If the results are kinda big, it is better if you use mysql_fetch_row or mysql_fetch_assoc since mysql_fetch_array double the entries for numeric and associative.
From the manual:
mysql_fetch_row() - Get a result row as an enumerated array
mysql_fetch_array() - Fetch a result row as an associative array, a numeric array, or both
mysql_fetch_assoc() - Fetch a result row as an associative array
mysql_fetch_object() - Fetch a result row as an object
|
|
|
|