Right now when I run the following query SELECT * FROM table I get the following response
array(1) {
[0]=>
array(36) {
[0]=>
string(5) "31764"
["id"]=>
string(5) "31764"
...
}
...
}
As you can see I am getting 2 of the same data (“0” and “id”). Is there any way I can only get “id” and not “0”?
Check the documentation of
mysql_fetch_array(), the second argument allows you to specify what kind of array to return:Or you could just use
mysql_fetch_assoc().