I attempt to insert data with this code $user_name = mysqli_real_escape_string($mysqli, $POST[“user_name”]); $user_pass = mysqli_real_escape_string($mysqli, $POST[“user_pass”]); $user_email = mysqli_real_escape_string($mysqli, $POST[“user_email”]); $sql = “INSERT INTO users(id, user_name, user_pass, user_email ,user_level) VALUES(NULL, $user_name, $user_pass, $user_email, 0)”; $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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.