0

I keep getting this error"

Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in C:\xampp\htdocs\php-contact-form\index.php on line 8

this is the connection i used:

$conn = mysqli_connect("localhost","root","Guyle4u2021","newDolce") or die("Connection Error: " . mysqli_error($conn));
Dharman
  • 30,962
  • 25
  • 85
  • 135
  • Might want to re-read the [mysqli_error() manual](https://www.php.net/manual/en/mysqli.error.php) - it has examples – brombeer Feb 20 '21 at 10:31
  • 1
    Something to consider - https://stackoverflow.com/questions/58808332/should-we-ever-check-for-mysqli-connect-errors-manually – Nigel Ren Feb 20 '21 at 10:33

1 Answers1

-2

By the looks of it, you need to remove the "or die("Connection Error: " . mysqli_error($conn))" and see what happens.

Also, id recommend switching to PDO because it's more consistent and is more widely used by the community, therefore additional support.