arunpatal Posted December 27, 2012 Share Posted December 27, 2012 Hi, Look this table table 1 id int ai pkey country v 75 table 2 id int ai pkey name v 75 country int My form is to add data on table 2 where name is text field and country is menu which shows label as country and save its value as id from table 1. now the added entry in my table 2 is like this name and country id now i want to make page where i can show the table 2 information but instead of country id i want to show the name of country which is in table 1.... how can i do that ???????????? Link to comment https://forums.phpfreaks.com/topic/272408-getting-information-via-id/ Share on other sites More sharing options...
thara Posted December 27, 2012 Share Posted December 27, 2012 here you need to use JOIN clause try something like this.... SELECT name, country FROM table2 INNER JOIN table1 ON table1.countryId = table2.countryId Link to comment https://forums.phpfreaks.com/topic/272408-getting-information-via-id/#findComment-1401537 Share on other sites More sharing options...
arunpatal Posted December 27, 2012 Author Share Posted December 27, 2012 here you need to use JOIN clause try something like this.... SELECT name, country FROM table2 INNER JOIN table1 ON table1.countryId = table2.countryId Thanks am testing............ will get back after test Link to comment https://forums.phpfreaks.com/topic/272408-getting-information-via-id/#findComment-1401551 Share on other sites More sharing options...
arunpatal Posted December 27, 2012 Author Share Posted December 27, 2012 Thanks am testing............ will get back after test merry christmas......... it works Link to comment https://forums.phpfreaks.com/topic/272408-getting-information-via-id/#findComment-1401553 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.