Jon T
01-14-2004, 06:37 AM
Before I start, here are two example URLs that display what I am doing now, and what I want to be doing.
Example Link of how it is working now, and is wrong (http://www.meyercountryfarms.com/search/results.asp?myState=AZ)
Example Link of the way I would Like it all to look (http://www.meyercountryfarms.com/wheretobuy/retailstorelist.asp)
I have created the following MySQL Statment to pull from two tables.
Table One: Stores - This table lists all main Retailers.
Table Two: Locations - This table lists all locations of a Retailer.
So, I match the storeID from stores to locations. When this match is good, a Retailer has Locations that can then be returned as a search result.
So, if a given Retailer or Store has multiple Locations, the results look like this.
Store 1, Location 1
Store 1, Location 2
Store 2, Location 1
I would prefer to look like.
Store 1, Location 1, Location 2
Store 2, Location 1
So now, instead of having one repeat reagion for the first example, I have to build a Logical 2 Repeat Reagion.
IF, a Store has a Location, Display the store, then all of its locations. Here is my current SQL Statement.
---- START MYSQL ----
SELECT stores.storeID, stores.Name, stores.URL, locations.storeID, locations.Location, locations.unitNUM, locations.Address1, locations.Address2, locations.City, locations.State, locations.Zip, locations.Phone, locations.Viewable
FROM stores, locations
WHERE stores.storeID = locations.storeID AND locations.State = 'valOne' AND locations.Viewable = '1'
ORDER BY stores.Name
---- END MYSQL ----
TYIA for any help in this matter.
Example Link of how it is working now, and is wrong (http://www.meyercountryfarms.com/search/results.asp?myState=AZ)
Example Link of the way I would Like it all to look (http://www.meyercountryfarms.com/wheretobuy/retailstorelist.asp)
I have created the following MySQL Statment to pull from two tables.
Table One: Stores - This table lists all main Retailers.
Table Two: Locations - This table lists all locations of a Retailer.
So, I match the storeID from stores to locations. When this match is good, a Retailer has Locations that can then be returned as a search result.
So, if a given Retailer or Store has multiple Locations, the results look like this.
Store 1, Location 1
Store 1, Location 2
Store 2, Location 1
I would prefer to look like.
Store 1, Location 1, Location 2
Store 2, Location 1
So now, instead of having one repeat reagion for the first example, I have to build a Logical 2 Repeat Reagion.
IF, a Store has a Location, Display the store, then all of its locations. Here is my current SQL Statement.
---- START MYSQL ----
SELECT stores.storeID, stores.Name, stores.URL, locations.storeID, locations.Location, locations.unitNUM, locations.Address1, locations.Address2, locations.City, locations.State, locations.Zip, locations.Phone, locations.Viewable
FROM stores, locations
WHERE stores.storeID = locations.storeID AND locations.State = 'valOne' AND locations.Viewable = '1'
ORDER BY stores.Name
---- END MYSQL ----
TYIA for any help in this matter.