There are two ways to connect to a database using PHP. ... In Read operations, we will use only select queries to fetch data from the database. MySQLi Object-Oriented $conn->query($query); MySQLi Procedural mysqli_query($conn, $query) PDO. $stmt = $conn->prepare($query); $stmt->execute(); Mar 17, 2022