Jump to content

[SOLVED] Using two different databases to reduce results in PHP


upperbid

Recommended Posts

Say I first generate a list of results of purchases from a specific user from a database showing the product number with all the other data, which I can already do successfully.  For example, results currently are like:

 

Product number, Description, Quantity, Price

7897797, chair, 1, $49.99

8797879, stool, 2, $24.99

6897679, table, 1, $149.99

 

I then need to further limit those results based on criteria from another database which only gives information on the product, such as the manufacturer but does not contain any of the purchase information. Say I wanted to only return the results of the purchases from that buyer that were from a manufacturer called Tom's Wood which would be stored in another database.

 

I can use the product number from the first results since the product number is the common factor in both databases, but I'm not quite sure how to do this second part.  I would like the result to return both parts for the specified criteria (in this case all purchases from the buyer with the specified manufacturer Tom's Wood) together like:

 

Product number, Manufacturer, Description, Quantity, Price

7897797, Tom's Wood, chair, 1, $49.99

8797879, Tom's Wood, stool, 2, $24.99

 

Any suggestions would be appreciated.

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.