Complete PHP MySQL Reference
The mysql_fetch_assoc() function returns a row from a recordset as an associative array.
This function gets a row from the mysql_query() function and returns an array on success, or FALSE on failure or when there are no more rows.
| Parameter | Description |
|---|---|
| data | Required. Specifies which data pointer to use. The data pointer is the result from the mysql_query() function |
Note: After the data is retrieved, this function moves to the next row in the recordset. Each subsequent call to mysql_fetch_assoc() returns the next row in the recordset.
Tip: Field names returned by this function are case-sensitive.
The output of the code above could be:
Complete PHP MySQL Reference
Your message has been sent to W3Schools.