INSERT INTO syntax Error MYSQL with PHP
I attempt to insert data with this code
$username = mysqlirealescapestring($mysqli, $POST[“username”]);
$userpass = mysqlirealescapestring($mysqli, $POST[“userpass”]);
$useremail = mysqlirealescapestring($mysqli, $POST[“useremail”]);
$sql = “INSERT INTO
users(id, username, userpass, useremail ,userlevel)
$result = mysqli_query($mysqli, $sql);
However when I actually launch the query, I get an error that says this.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’ , , 0)’ at line 4
I also know this isn’t a very secure at all, but it’s for school and not for actual use.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.