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']; // [email protected] $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 Link to comment https://forums.phpfreaks.com/topic/67330-solved-inserting-email-address-into-db/ 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. Link to comment https://forums.phpfreaks.com/topic/67330-solved-inserting-email-address-into-db/#findComment-337783 Share on other sites More sharing options...
iPixel Posted August 30, 2007 Author Share Posted August 30, 2007 Lol yep.. thanx ! Link to comment https://forums.phpfreaks.com/topic/67330-solved-inserting-email-address-into-db/#findComment-337798 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.