Javiator
0
Q:

show mysqli_query error


<?php

$con=mysqli_connect("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($con,"INSERT INTO Persons (FirstName)
VALUES ('Glenn')")) {
  echo("Error description: " . mysqli_error($con));
}

 
mysqli_close($con);

?>
 
2

New to Communities?

Join the community