PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I think I'm getting the array conversion wrong. I am trying to copy the results of the query from one array to another. However I am not sure how to assign name/value pairs into the array. Code below:
If your query has 3 columns, "apple", "orange", "peach", and you want to put those three words in an array as keys, with the values of the columns as array values, you do this:
If you use mysql_fetch_assoc() (or the equivalent for whichever database you're using), the value returned from the function will already be an associative array like '$myArray' above.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.