RE: [PHP-DB] matching data from one table with another and displa ying results?
| From: | HP-Richardson,ex1) | Date: | Tue, 04 Feb 2003 16:58:40 +0000 |
| Subject: | RE: [PHP-DB] matching data from one table with another and displa ying results? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-25428@lists.php.net to get a copy of this message | ||
Seek out LEFT JOIN on mysql web site, thats what you want.
Cheers
Jason
-----Original Message-----
From: Aaron Wolski [mailto:aaronjw@martekbiz.com]
Sent: Tuesday, February 04, 2003 10:43 AM
To: php-db@lists.php.net
Subject: [PHP-DB] matching data from one table with another and
displaying results?
Hi All,
Having a problem figuring out the logic of something here and hoping
someone can point me in the right direction.
I have 2 tables.
First table holds a listing of all Provinces and States. Here a brief of
what it looks like:
value label
AB Alberta
BC British Columbia
MB Manitobia
NF Newfoundland
NT Northwest Territories
NS Nova Scotia
Second Table is an OrderTable which holds all order and customer info
including the province/state. The province/state is dumped from the
"value" column of the ProvinceTable. Meaning.. an order record would
show the province as "AB" or "NS" instead of "Alberta" or "Nova
Scotia".
I am creating an order report and in this report I want to display the
LABEL name of the Province/State that relates to an the province column
in the OrderTable.
I could simply just display all provinces/states from the ProvinceTable
but then there would be entries for selection that had NO orders.
Any idea on this? Thanks guys!
Aaron