Answers for "php check if query succeeded"

PHP
0

php check if query succeeded

<?php
	// peform a query 
      $query = "SELECT `*` FROM user";
      $results = mysqli_query($databaseConnection, $query);

      if (mysqli_num_rows($results) == 0) {
        // The query returned 0 rows!
      } else {
        // the query returned ATLEAST one row
      }

      if (mysqli_num_rows($results) >= 5) {
        // the query returned more than 5 rows
        }
?>
Posted by: Guest on April-14-2020

Code answers related to "php check if query succeeded"

Browse Popular Code Answers by Language