hi, I know this is sound crazy but I'm still rookie try to undersand how to write that php code.
I have signup form and one of text fields relate to country, the country is comes with code number. So let say I have two database tables which is called "country" and "country_code" in table name "country_code" has two columns which is list of countries and list of code number.
See sample columns
Country_code table...
country code
---------- ------
usa 253
canada 259
Demark 521
So when person select country it will retreive code number that are match with country name and then insert country code into the country database.
does any one help me how can i write that code !
please thanks.
AM
php database...
Moderator: General Moderators
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: php database...
What you're trying to do is relatively straight forward, but there are many ways to do it. What have you tried so far? Have you started writing any code, and can you share it?
When the form is submitted, one of the post variables will be the country. Based on the value of the country you would run a database SELECT query to get the country code. Next, you would run a database INSERT query to insert the country code into your other table.
I question your database design, but we all have to start somewhere
Show us what you've got an we'll see if we cant help connect the dots.
When the form is submitted, one of the post variables will be the country. Based on the value of the country you would run a database SELECT query to get the country code. Next, you would run a database INSERT query to insert the country code into your other table.
I question your database design, but we all have to start somewhere
Show us what you've got an we'll see if we cant help connect the dots.
Re: php database...
No i have not write any code because i do not understand how to reterive that from other database.
do you have any sample site where i can learn more about those!
AM
do you have any sample site where i can learn more about those!
AM
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: php database...
Sure, try w3schoolsAlidad wrote:No i have not write any code because i do not understand how to reterive that from other database.
do you have any sample site where i can learn more about those!
AM
http://www.w3schools.com/PHP/php_mysql_intro.asp
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: php database...
Haha, hadnt seen that beforeMcInfo wrote:Re: W3Schools
I guess that's the last plug they get from me.