Downloaded 56 times





![Select OOP $sql = "SELECT id, firstname, lastname FROM MyGuests"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]; } } else { echo "0 results"; }](https://image.slidesharecdn.com/3mysql-170612093724/75/Database-Management-Lecture-4-PHP-and-Mysql-6-2048.jpg)
![Select Procedural $sql = "SELECT * FROM students"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { echo "id: " . $row["id"]; } } else { echo "0 results"; }](https://image.slidesharecdn.com/3mysql-170612093724/75/Database-Management-Lecture-4-PHP-and-Mysql-7-2048.jpg)





The document discusses PHP and MySQL connections and queries. It shows how to connect to a MySQL database using PHP, perform SELECT, INSERT, UPDATE and DELETE queries both in an OOP and procedural style, and check for errors. Examples are given for connecting to a database, running queries, fetching and displaying results, and performing CRUD operations.