I tried lot of thinks to resolve the error in the title.
I don't know why but this code generate an Error 500
$sql = 'INSERT INTO compte (creationdate, password, photo, mail) VALUES (NOW(), "$2y$10$60y2xoq8y1E5wNOmrI.V9umrp4br2cJ3iZS5MVNNXGkFvMq8Pgxmy", "images_utilisateurs/PP.jpg", "blabla@gmail.com")';
try {
$mysqli->query($sql);
$mysqli->commit();
} catch (Exception $e) {
$mysqli->rollback();
}
have no issue to show the data from my database but in insertion, it's impossible. The issus is only in the try catch block
EDIT :
Here my connexion script:
$mysqli = mysqli_init();
if (!$mysqli) {
die('mysqli_init failed');
}
if (!$mysqli->real_connect('localhost', 'root', 'root', 'allvisio')) {
die('Connect Error (' . mysqli_connect_errno() . ') '
. mysqli_connect_error());
}
I have no error here in php.ini, I'm using the default value...
Thanks for any support
EDIT 2 : SOLUTION
By hasard (like sometime) I found the solution I'm using function to do my request, so we need to declare global $mysqli; each time a want to request into my database. easy, but not clear.