returns a Good message, and even the code for email sending that happens right after it works, other tables have no issues with inserts, its just this one.
In either case, the execute function also returns a result true or false. This result tells you whether the query was successful or not, e.g.:
$result = $insertsql->execute(...);
if ($result) {
echo "all is good!";
} else {
echo "database error: ".$conn->error;
}
Checking whether $insertsql is false doesn’t really do anything. It only tells you whether the statement was created correctly, not whether it executed successfully. And assuming that code is below your insertion code, the case where it would happen your code would just crash.
OK, you conclude that it “just doesn’t do anything”. So can you please describe what do you actually see? Because phpMyAdmin should either show an error or tell you that a row has been inserted. It should never “doesn’t do anything”.