goytmill Posted August 3, 2012 Share Posted August 3, 2012 Hi there, I am trying to pull data from 2 tables in a php script and was wondering if someone could be kind enough to help me out as I'm struggling to find anything that will work. The basis is table 1 (called "specialorder") has a column with the suppliers ID number (called "Supplier" in table one) and matches data in table 2 (table is "supplier", column name "ID"). What I would like to do, and have spent 2 days trying and failing miserably is to get the data from table one on the screen (done that) but when it comes to the supplier info it takes the suppliers ID from table 1, matches it with table 2 but then displays the suppliers name, not the ID number. Is this possible? and if so please can some one help out. Thanks in advance, Phil :confused: Quote Link to comment https://forums.phpfreaks.com/topic/266657-newbie-joining-pulling-data-from-2-tables/ Share on other sites More sharing options...
mikosiko Posted August 3, 2012 Share Posted August 3, 2012 .....as I'm struggling to find anything that will work...... maybe there is were your problem start.... you don't have "to find".... you have to learn how to write a simple JOIN here http://dev.mysql.com/doc/refman/5.0/en/join.html you're going to find how must be done with several examples... just write code and try... if still having problems post the code that you have tried and ask specific doubts. Quote Link to comment https://forums.phpfreaks.com/topic/266657-newbie-joining-pulling-data-from-2-tables/#findComment-1366680 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.