iPixel Posted August 30, 2007 Share Posted August 30, 2007 Im inserting users into a table... $name = $_POST['name']; $username = $_POST['username']; $email = $_POST['email']; // blahblah@whatever.com $password = $_POST['password']; $access = $_POST['access']; echo $name . "<BR>" . $username . "<BR>" . $email . "<BR>" . $password . "<BR>" . $access . "<BR>"; $query = "INSERT INTO users (name, username, email, password, access) VALUES ($name, $username, $email, $password, $access)"; $sql = mysql_query($query) or die('<BR><BR>Query Crapped Out! <BR><BR>' . mysql_error()); But when i run the page it returns error : 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 '@email.com, 12345, PS)' at line 1 No clue whats up with that Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 30, 2007 Share Posted August 30, 2007 text fields normally need quotes around them so for each $xxx you need to use '$xxx' when the field is NOT simply an integer. Quote Link to comment Share on other sites More sharing options...
iPixel Posted August 30, 2007 Author Share Posted August 30, 2007 Lol yep.. thanx ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.