nathanurag Posted September 6, 2007 Share Posted September 6, 2007 i have created forms in html now i want to connect those forms to the database through php pls tell me how to connect html forms to the database Quote Link to comment https://forums.phpfreaks.com/topic/68241-need-help-in-coding/ Share on other sites More sharing options...
wildteen88 Posted September 6, 2007 Share Posted September 6, 2007 What do you mean by "connect"? What does the form collect. What are trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/68241-need-help-in-coding/#findComment-343037 Share on other sites More sharing options...
tibberous Posted September 6, 2007 Share Posted September 6, 2007 In the future, I would make my forms in php, so you can have them submit to themselves and give error messages. Basically you need to have your html forms submit to a php page, then that php page needs to connect to the database and insert the data. Thats the basics, in a real-world situation you would need to have the form getting the data also make sure that the user input was complete / good, and you would probably want to check and make sure not to duplicate records. Go to php.net, look up mysql_connect and mysql_select_db and mysql_query, those are the only mysql functions you'll need to do this. Quote Link to comment https://forums.phpfreaks.com/topic/68241-need-help-in-coding/#findComment-343038 Share on other sites More sharing options...
cooldude832 Posted September 6, 2007 Share Posted September 6, 2007 In the future, I would make my forms in php, so you can have them submit to themselves and give error messages. Not true, what I actually do with my forms is make them seperate files (like form_1.html) and then have them be included in a document where needed and the values are equal to $error['fieldname'] which can be made on a processor page that reincludes that form. But anyway I think for you to do what you are trying you need to initally learn the ins/outs of mysql/php interaction, get phpmyadmin on your server and start making tables Quote Link to comment https://forums.phpfreaks.com/topic/68241-need-help-in-coding/#findComment-343045 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.