My update of the database has no problems whatsoever. And down in my local development environment a new record insert also has no problems. I have tried changing my MySQL user many times because I thought it might be about permissions (maybe that is still the problem, I don't know). I have even made the user root and supplied my correct root password: again, I can perform updates, but no new record inserts. Here is my code which I have shortened (i.e taken out the large number of fields. It works locally, but not on the server).
I am on Ubuntu Linux, 16.04, PHP 7
$message = '';
$db = new mysqli('localhost', 'root', 'notrealpword', 'mydatabase');
if ($db->connect_error){
$message = $db->connect_error;
}else{
// echo $message ;
}
$prep = $db->prepare("INSERT INTO users (userid, username) VALUES
('0',?)");
//Now, you can bind some parameters.
$prep->bind_param('s',$username);
$username = "atservertest";
$prep->execute();
$numaffected = $prep->affected_rows ;
echo $numaffected;
// echo $numaffected . " row(s) affected." ;
$prep->close();