waelkd Posted May 11, 2011 Share Posted May 11, 2011 so here's the thing, ive downloaded mysql front and easy php , the HTML code ive written till now is <html> <head> </head> <body> <h1>Registration Page</h1> <form name="form" method="post" action="final-SignUp1.php"> <p>UserName <input type="text" name="username" /></p> <p>Password <input type="password" name="password" /></p> <p>Confirm Password<input type="password" name="confirm_password" /></p> <p>Firstname <input type="text" name="firstname" /></p> <p>Middlename <input type="text" name="middlename" /></p> <p>Lastname <input type="text" name="lastname" /></p> <p>address <input type="text" name="address" /></p> <p>city <input type="text" name="city" /></p> <p>Zipcode <input type="text" name="zip_code" /></p> <p>Phone number <input type="text" name="telephone_number" /></p> <p>Email address <input type="text" name="email" /></p> <p>Confirm Email <input type="text" name="confirm_email" /></p> <input type="submit" value="Register"> <input type="reset" value="Clear" /></p> </form> </body> </html> which i would like to link to this php code <?php $usr=$_POST["username"]; $pass=$_POST["password"]; $confirm=$_POST["confirm_password"]; $firstname=$_POST["firstname"]; $middlename=$_POST["middlename"]; $lastname=$_POST["lastname"]; $address=$_POST["address"]; $city=$_POST["city"]; $zipcode=$_POST["zip_code"]; $phonenumber=$_POST["`telephone_number`"]; $emailaddress=$_POST["email"]; $confirmemailaddress=$_POST["confirm_email"]; $db=mysql_connect("localhost","root",""); mysql_select_db("final-signup1",$db); $q="INSERT INTO final-signup1 VALUES ('$usr','$pass','$confirm','$firstname','$middlename','$lastname','$address','$city','$zipcode', '$phonenumber','$emailaddress','$cofirmemailaddress')"; mysql_query($q); mysql_close(); ?> now on mysql-front the database ive set till now is as follows i know something is wrong with my code, because the data i enter in the register page isnt going to the database. any help is greatly appreciated thank you Quote Link to comment https://forums.phpfreaks.com/topic/236097-need-help-checking-my-php-coding/ Share on other sites More sharing options...
parino_esquilado Posted May 11, 2011 Share Posted May 11, 2011 I'm sure you must have an ID field preceding the 'username' field, but to be sure, could you edit this line: mysql_query($q); to mysql_query($q) or die(mysql_error()); and see what crops up Quote Link to comment https://forums.phpfreaks.com/topic/236097-need-help-checking-my-php-coding/#findComment-1213880 Share on other sites More sharing options...
BluB Posted May 11, 2011 Share Posted May 11, 2011 I did notice you made a typo in your SQL statement: $cofirmemailaddress instead of $confirmemailaddress I doubt it's the problem, but figured I might as well point it out. Quote Link to comment https://forums.phpfreaks.com/topic/236097-need-help-checking-my-php-coding/#findComment-1213961 Share on other sites More sharing options...
xyph Posted May 11, 2011 Share Posted May 11, 2011 Your query is what's wrong. Echo out $q, and run it in mysql front. Check the errors returned. Read up more on INSERTing with SQL http://dev.mysql.com/doc/refman/5.5/en/insert.html Quote Link to comment https://forums.phpfreaks.com/topic/236097-need-help-checking-my-php-coding/#findComment-1213970 Share on other sites More sharing options...
waelkd Posted May 12, 2011 Author Share Posted May 12, 2011 I'm sure you must have an ID field preceding the 'username' field, but to be sure, could you edit this line: mysql_query($q); to mysql_query($q) or die(mysql_error()); and see what crops up did it and still facing same problem , and now i got a new problem, every time i click on the register button, a save-as tab opens Quote Link to comment https://forums.phpfreaks.com/topic/236097-need-help-checking-my-php-coding/#findComment-1214732 Share on other sites More sharing options...
waelkd Posted May 12, 2011 Author Share Posted May 12, 2011 I did notice you made a typo in your SQL statement: $cofirmemailaddress instead of $confirmemailaddress I doubt it's the problem, but figured I might as well point it out. thx budy Quote Link to comment https://forums.phpfreaks.com/topic/236097-need-help-checking-my-php-coding/#findComment-1214733 Share on other sites More sharing options...
waelkd Posted May 12, 2011 Author Share Posted May 12, 2011 WOOOT WOOOT, IT WORKED!!! had a couple of syntax error, all is good now. thx for the help guys! Quote Link to comment https://forums.phpfreaks.com/topic/236097-need-help-checking-my-php-coding/#findComment-1214746 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.