How do we fetch the result of the query as an associative array in PHP?
Tuesday, 08 August 2023
by EITCA Academy
To fetch the result of a query as an associative array in PHP, you can make use of the mysqli_fetch_assoc() function. This function retrieves the next row from a result set as an associative array, where the column names are used as keys. Here's an example of how you can use this function: php //
- Published in Web Development, EITC/WD/PMSF PHP and MySQL Fundamentals, Advancing with MySQL, Getting a single record, Examination review
Tagged under:
Associative Array, Database Connection, MySQL, Mysqli_fetch_assoc(), PHP, Web Development