Schlo_50 Posted March 9, 2007 Share Posted March 9, 2007 I need to send the delivery details of customers to my database. I have managed to create a register script for users to create a username and password which then gets stored into the database. I copied and pasted the same script and then adapted the variables to suit the new form's values and the database structure, however, i seem to be doing something wrong as i keep getting parse errors etc.. Can someone take a look at my now, more slightly modified script to see what is wrong? <?php $self=$_SERVER['PHP_SELF']; $title=$_POST['title']; $firstname=$_POST['fname']; $surname=$_POST['sname']; $addline1=$_POST['adline1']; $addline2=$_POST['adline2']; $city=$_POST['city']; $postcode=$_POST['postcode']; $contact=$_POST['hphone']; $email=$_POST['email']; ?> <?php $conn = mysql_connect( "host","hostuname","password" ) or die( "Err:Conn" ); $rs = mysql_select_db( "database", $conn ) or die( "Err:Db" ); if(isset($_POST[submit])){ $sql= "INSERT INTO cust_tbl ( title,fname,sname,adline1,adline2,city,postcode,hphone,email )VALUES( \"$title\",\"$firstname\",\"$surname\",\"$addline1\",\"$addline2\",\"$city\",\"$postcode\",\"$contact",\"$email") )";} else { Poo form } $rs = mysql_query( $sql, $conn ); if ($rs){ echo( "Order Form Complete $firstname!" ); } ?> Thanks in advance guys! Link to comment https://forums.phpfreaks.com/topic/41928-help-with-details-script/ Share on other sites More sharing options...
papaface Posted March 9, 2007 Share Posted March 9, 2007 Should be: $sql= "INSERT INTO cust_tbl ( title,fname,sname,adline1,adline2,city,postcode,hphone,email )VALUES( '$title','$firstname','$surname','$addline1','$addline2','$city','$postcode','$contact','$email')"; Link to comment https://forums.phpfreaks.com/topic/41928-help-with-details-script/#findComment-203302 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.