Thursday, October 20, 2011

PHP mysql_fetch_array What's the Difference between MYSQL_NUM and MYSQL_ASSOC

Here we suppose to have a SQL Query stored in the Variable $query.
  • mysql_fetch_array($query,MYSQL_NUM) Process the Results of the Query and for Each Row Returned Discard the Column Name and Store the Row Content Popping it into a Common Array
  • mysql_fetch_array($query,MYSQL_ASSOC) Process the Results of the Query and for Each Row Returned Store the Column Name as the Key and the Content as the Value Popping them into an Associative Array