Gilbert Posted March 1, 2018 Share Posted March 1, 2018 (edited) I'm learning php & sql. I can do the programming and logic, but how to put it all together is where I get confused. I have copied, from the w3 tutorial, the php form validation complete, and it worked fine. I have also used the php/sql database tutorial to copy the 'insert into' code and it works fine with a Db I set up on the local host. Now I would like to save the info in the form to a database table, but I'm not sure where to insert the code to connect to the database. I tried just adding the code at the bottom of the 'Form Complete' code but it didn't seem to take - no error codes but didn't get saved to the table. If I should keep it as a separate file, how and where do I call that file with the parameters I want to insert into the database? Is there anything on the w3 site that deals with this 'real life' situation. The tutorials are very good, but (everybody's got a big butt) the examples all use literals and they don't relate to a problem like I've explained here. I mean, why else would you have somebody fill in a form except to save the info in a table for future reference?? Any help going forward would be greatly appreciated. I didn't post the code here to save space, so if you're not sure what code I'm talking about, it's at w3schools and under PHP tutorial goto PHP forms 'Form Complete' and just below that in the SQL section is the code for Inserting data into a mySQL database. If I need to, I will post it. Thanx, Gil Edited March 1, 2018 by Gilbert Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now