I'm having trouble inserting an email address into a MySQL database. I'm getting the dreaded 1064 error like so..
Error creating new user You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '@email.com, password, 20)' at line 1 -- 1064
So I'm guessing I need to escape the @ in the email variable? But nothing i do seems to please Maria. Generating the query in PHPMyAdmin was no help either. Any advice gratefully accepted.
// update SQL
$sql2 = "INSERT INTO members (username, email, password, balance) VALUES ($new_player, $new_email, $new_password, 20)";
if ($db->query($sql2) == TRUE) {
echo "** New User Created **<BR>";
} else {
echo "Error creating new user " . $db->error." -- ". $db->errno ."<BR>";
}