Code-Samples/php/Php-andor.php Using AND Operator in Mysqli connect_error) { die("Connection not established: " . $connection->connect_error); } $query = "Use Hospital;"; $connection->query($query); // Using AND Operator $query = "SELECT patient_fname, patient_age ". "FROM Patient ". "WHERE patient_age BETWEEN 30 and 50 AND patient_fname LIKE '%x'"; $output = $connection->query($query); if ($output->num_rows > 0) { // output data of each row while($row = $output->fetch_assoc()) { echo "First Name: " . $row["patient_fname"]." Age: " . $row["patient_age"]."
"; } } else { echo "0 results"; } $connection->close(); ?>