leest Posted December 20, 2007 Share Posted December 20, 2007 Hi, I have a query which uses join, now the query works perfectly well and i am able to retrieve data from the tables that are joined. The only problem i do have is that two tables in seperate databases have the same field name. This means that when i echo the result i am getting the result from the wrong table. For example table two has the field status: Table three has the field status so when i do the following: echo $row['status']; it returns the data for the field stored in table two. is there away that i can specify which table i want the information from. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/82434-solved-duplicatetable-fields/ Share on other sites More sharing options...
fenway Posted December 20, 2007 Share Posted December 20, 2007 Well you should always specify the table name/alias when retrieving columns... but in this case, you want to use a column alias... e.g. field1 AS MyFavField. Quote Link to comment https://forums.phpfreaks.com/topic/82434-solved-duplicatetable-fields/#findComment-419677 Share on other sites More sharing options...
leest Posted December 20, 2007 Author Share Posted December 20, 2007 cool, thanks i'll give it a go. Cheers Lee Quote Link to comment https://forums.phpfreaks.com/topic/82434-solved-duplicatetable-fields/#findComment-419744 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.