EagerWolf Posted May 21, 2007 Share Posted May 21, 2007 I've 2 databases... First database (with articles): 1: producer = 1 model = some_text ... 2: producer = 3 model = some_text ... Second database (producers) 1 = Toshiba 2 = HP 3 = Dell I want to use second database when outputting... Example (for first product): Producer: Toshiba ... So I want to write Toshiba instead of 1... Please help! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/52319-mysql-problem-with-ids/ Share on other sites More sharing options...
georg Posted May 21, 2007 Share Posted May 21, 2007 Are you talking about databases or tables? with tables, you could do that with a left join.. SELECT table1.model, table2.producer FROM table1 LEFT JOIN table2 ON (table1.producer=table2.id) Something like this should work... Quote Link to comment https://forums.phpfreaks.com/topic/52319-mysql-problem-with-ids/#findComment-258155 Share on other sites More sharing options...
EagerWolf Posted May 21, 2007 Author Share Posted May 21, 2007 Yes it should work... But in this case I don't get all information from database... What I want to do ... Is to change from ID to 'producer_name' and still keep all results... Quote Link to comment https://forums.phpfreaks.com/topic/52319-mysql-problem-with-ids/#findComment-258179 Share on other sites More sharing options...
AndyB Posted May 21, 2007 Share Posted May 21, 2007 OK, it's time to show us some code ... the query you're using and the script section that displays the results Quote Link to comment https://forums.phpfreaks.com/topic/52319-mysql-problem-with-ids/#findComment-258182 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.