PHP MySQL result into Array
I would like to "SELECT * FROM 'table'" and put the result into an array, but the array keys should represent the table columns (assuming I don't know them in advance).
I see many examples for code that extracts the data into arrays in which I have to put the keys manually, but I'm looking for something automatic.
For example, if the table is something like this:
ID Name Address
-- ----- --------
1 John New York
2 Terry Miami
The array should be:
[ID]=>1 [Name]=>John [Address]=> New York
[ID]=>2 [Name]=>Terry [Address]=> Miami
What should I do?