This topic is locked

Displaying data from two tables on one page

2/22/2006 8:46:10 PM
PHPRunner General questions
R
rhoward author

I am trying to display data from two tables on one page.

In this application WAREHOUSE = STK WAREHOUSE
I want to have on the same page and on the same line, data from the INVENTORY TABLE displaying the availability of an item in stock and data from the ZIP CODE TABLE that will tell them which warehouse with stock is the nearest to their zip code. I will have the user utilize the advance search to enter their zip code and the part number of the part that they are looking for.
The result will look something like this repeated for every warehouse that has the part in stock but always related to the [MY ZIPECODE]
[PARTID] [PARTDESC] [STKQTY] [STK WAREHOUSE] [MY ZIPCODE] [DISTANCE]
Is this possible??
If so Help Help Help ..........
INVENTORY TABLE

STK WAREHOUSE

PARTID

PARTDESC

STKQTY
ZIPCODE TABLE

MY ZIPCODE

WAREHOUSE

WHSE ZIPCODE

DISTANCE

Sergey Kornilov admin 2/23/2006

Use SQL JOIN query. Something like this should work:

select

`STK WAREHOUSE`,

`PARTID`,

`PARTDESC`,

`STKQTY`,

`MY ZIPCODE`,

`WAREHOUSE`,

`WHSE ZIPCODE`,

`DISTANCE`

from INVENTORY

inner join ZIPCODE

on INVENTORY.`STK WAREHOUSE` = ZIPCODE.`WAREHOUSE`