PHP Select from Db

For the following example, we will assume we have already connected to a database called examples (and we have a $dbc already) and the database contains a table called users with ids, names and surnames.

Scenario. We want to retrieve all the data from users table.

We can now loop through the $users array to display our result in HTML