query('SELECT * FROM users'); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { echo $row['id'] . ' - ' . $row['name'] . ' - ' . $row['email'] . 'In this example, the PDO object is used to connect to the database, and the query method is used to retrieve all data from the "users" table. Once the query is executed, the while loop is used with the fetchAssoc function to loop through each row in the result set and print out the data in the form of an associative array. The package library used in this example is the PDO library, which is built-in to PHP and provides an easy and secure way to connect to and interact with databases.
'; } ?>