View Full Version : array help needed...

11-20-2012, 11:58 PM
I need help with creating an array.
I'm getting the mysql column keys using array_keys() but it loads the key name into the array.
ex: array('id')

I need it to load the actual key.
ex: array($id)

How can I accomplish this?

11-21-2012, 12:04 AM
You have to have the mysql query in an array, and then loop through that array. (say with- "$row as mysql_fetch_array($array)"). Then you can access the id of each row in that array with $row['id']. (As long as you've named the id column, - id -.

Hope that helps.

Array_keys() is used to get the key BTW.