Check out example codes for "mysqli_errno($dbcon) == 0". It will help you in understanding the concepts better.

Code Example 1

<?php

$mysqli = new mysqli("localhost","my_user","my_password","my_db");

  
if ($mysqli -> connect_errno) {

  echo "Failed to connect to MySQL: " . 
  $mysqli -> connect_error;
  
  exit();

  }

// Perform a query, check for error
if (!$mysqli -> query("INSERT INTO Persons (FirstName)
VALUES ('Glenn')")) {
  echo("Errorcode: " . $mysqli -> errno);

  }

 
$mysqli -> close();
?>

Learn ReactJs, React Native from akashmittal.com