I'm trying to replace my MySQL with MySQLi, and i get results - that's ok but when it comes to update MySQL my code fails ( I updated only the MySQL part)
inc_mysql_connect.php
$db = mysqli_connect($host, $user, $pass, $dbase) or die ();
inc_global_functions.php
if($_POST['costAlertTrue'] != "") {
// CHECKS AND IF ERROR - REDIRECT BACK
if(..) {$_SESSION['status'] ="E1"; header("Location: ./?page=cAlert"); exit();}
if(..) ...
// SQL
$sql = "UPDATE ".$dbprfx."_users SET costAlertVar = ? WHERE connection = ?";
$eintrag = $db->prepare($sql);
if ($eintrag->error()) { print($eintrag->error()); }
$eintrag->bind_param('ss',$costAlertVar,$userConnection);
$eintrag->execute();
$eintrag->close();
// REDIRECT
$_SESSION['status'] ="on"; header("Location: ./?page=cAlert");
} // End
Can Anyone find an Error in this piece of code?
Notice
if($_POST['costAlertTrue'] != "") {
die('XX'); exit('XX');
}
It seems that die(); exit(); or any other errors are not working in the if clause
Thx for all your help, i tried all your tips but suddenly it worked