user982019 Posted June 25, 2013 Share Posted June 25, 2013 Hello guys, I am bit stuck with my project i need your help.. I have a php form and sql database. My user are supposed to fill up a form and it goes to db and populate its fields. But, User will get an option of country "Which he can do multiple selection" So in my case their are 252 countries i.e: 252 tables. When user select like 3 countries such as: 3, 15, 20 Then the form he has filled should be populated to those 3 tables i.e: 3, 15, 20 And no other table should be disturbed.. So can anyone provide me a sample code for me how to do that.. i am stuck over here.. Please help ! Thanks in advance guys ! Quote Link to comment https://forums.phpfreaks.com/topic/279540-inserting-data-into-multiple-tables-based-on-user-selections/ Share on other sites More sharing options...
user982019 Posted June 25, 2013 Author Share Posted June 25, 2013 Please anyone ??? is here no one to guide me up... Quote Link to comment https://forums.phpfreaks.com/topic/279540-inserting-data-into-multiple-tables-based-on-user-selections/#findComment-1437762 Share on other sites More sharing options...
boompa Posted June 25, 2013 Share Posted June 25, 2013 (edited) Your question is very vague, and this here probably scared a lot of people off: So in my case their are 252 countries i.e: 252 tables. Sounds like you're working from a horrible database design, so you're already behind the 8-ball. Edited June 25, 2013 by boompa Quote Link to comment https://forums.phpfreaks.com/topic/279540-inserting-data-into-multiple-tables-based-on-user-selections/#findComment-1437774 Share on other sites More sharing options...
user982019 Posted June 25, 2013 Author Share Posted June 25, 2013 Your question is very vague, and this here probably scared a lot of people off: Sounds like you're working from a horrible database design, so you're already behind the 8-ball. Yea i know thats why i am asking for help.. atleast just anyone can guide me up what to use or how to use it up.. Quote Link to comment https://forums.phpfreaks.com/topic/279540-inserting-data-into-multiple-tables-based-on-user-selections/#findComment-1437780 Share on other sites More sharing options...
mac_gyver Posted June 25, 2013 Share Posted June 25, 2013 (edited) as to your design, you would have one table that stores the choices, one row per data item - id user_id country_id 1 1 3 2 1 15 3 1 20 4 2 yy 5 2 zz as to the code to take the submitted form data and insert it into a database table - php's original purpose was to process form data and there are literally 100's of thousands of examples of php form to database scripts posted all over the Internet. study some of those examples to see how others have accomplished this task. Edited June 25, 2013 by mac_gyver Quote Link to comment https://forums.phpfreaks.com/topic/279540-inserting-data-into-multiple-tables-based-on-user-selections/#findComment-1437787 Share on other sites More sharing options...
user982019 Posted June 25, 2013 Author Share Posted June 25, 2013 as to your design, you would have one table that stores the choices, one row per data item - id user_id country_id 1 1 3 2 1 15 3 1 20 4 2 yy 5 2 zz as to the code to take the submitted form data and insert it into a database table - php's original purpose was to process form data and there are literally 100's of thousands of examples of php form to database scripts posted all over the Internet. study some of those examples to see how others have accomplished this task. Thanks for your rough guidance.. i will try to have a go on it.. if anyone can have me any tutorial regarding this its awesome ! Quote Link to comment https://forums.phpfreaks.com/topic/279540-inserting-data-into-multiple-tables-based-on-user-selections/#findComment-1437846 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.