Fetching a result

Once you have an object returned in $result, you can use it to extract the data you want, one item at a time, using the fetch_assoc method of the object. Type this script in and save it using the filename query-mysqli.php

Fetching results one cell at a time:
Link to code

Here, each time around the loop, we call the fetch_assoc method to retrieve the value stored in each cell, and output the result using echo statements.

Leave a Reply

Your email address will not be published. Required fields are marked *