$query = "SELECT * FROM users WHERE email LIKE '%.com'"; $result = mysqli_query($conn, $query); $numRows = mysqli_num_rows($result); echo "Number of users with email ending in '.com': " . $numRows;
$date = "2021-08-01"; $query = "DELETE FROM orders WHERE order_date < '$date'"; $result = mysqli_query($conn, $query); $numRows = mysqli_affected_rows($result); echo "Number of deleted rows: " . $numRows;In both examples, mysqli is used as the PHP database library.