Jump to content

Newbie: Joining? Pulling Data from 2 tables


goytmill

Recommended Posts

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: :confused: :confused:

Link to comment
Share on other sites

.....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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.