Registration page in PHP

I am creating a PHP registration page and I'm completely confused as to what to do next.

Whenever the form is validated correctly and submitted, the only table that gets updated is the USERS table and it needs to also update SecInfo and Shipping.

This is a class assignment, and I am trying to finalize the kinks. I can feel I am close if one the mysql_query's are working out of 3.

if($errorCount == 0){

$userSQL = "INSERT INTO Users(UserID, FName, LName, Email, Phone, Address, City, UserState, Zip) VALUES ('{$uName}', '{$fName}', '{$lName}', '{$email}', '{$phone}', '{$add}', '{$city}', '{$uState}', '{$zip}')";

$secSQL = "INSERT INTO SecInfo(UserID, Password, SQuestion, SAnswer) VALUES ('{$uName}', '{$sec_pwd}', '{$sQues}', '{$sAns}')";

$shipSQL = "INSERT INTO Shipping(ShipAdd, ShipCity, ShipState, ShipZip)VALUES ('{$shipAdd}', '{$shipCity}', '{$sState}', '{$shipZip}')";


echo "Successfully submitted!";
echo "Form data missing for specific fields!";

QUESTION: (If you need HTML you can ask) Is the code not inserting into SecInfo and Shipping because I am calling the mysql_query method too many times at the end?

This is a contained project, as in sql_injection isn't going to be an issue.


Do you have a specific question? I'm confused as to what you need help with exactly. But I noticed you've got quit a bit of SQL/PHP jumbled up into a long sequence of tasks. My advice, would be to start small, test your code, then carefully add new pieces of code and test it constantly, this is how you will understand where the error lies, and why the SecInfo and Shipping tables are not being updated.

Also, it looks like there is a lot of unnecessary stuff in your code, if all your doing is updating/adding to 3 tables, you shouldn't need that many lines of code. hope this helps.

Need Your Help

How to handle multiple backbone model changes in one handler

backbone.js marionette backbone-events backbone-model

I have a View and a Model associated with it in backbone. View observe for model changes and change its displaying area accordingly. for example: