I’m trying to figure out exactly how I should work around this. When I have one MySQLi query fail, it automatically kills the rest of the script. For instance
//Pure example code
$data = $mysqli->prepare("somequery");
$data->execute(); // Execute the prepared query.
//If the query above fails, the rest of the script doesn't get executed.
Basically, I’m trying to figure out how I can stop PHP from killing the script when the query fails. Any ideas? I moved to prepared statements because of the supposed performance and security gains. It’d be a pain to rewrite everything to plan old queries.
Thanks,
You need to actually check for success, rather than blindly executing
$data->execute()whendatamay befalse, which will raise an error and abort your script.From the docs,
prepare…