| David B 2005-07-07, 7:14 am |
| At http://www.geosymbols.org/resources/flowers/state.php you can see a
table that displays a list of state flowers, along with flowers
reprsenting the U.S. territories and Canada's provinces. This is the
script I use to display it:
[PHP]
[PHP SWITCH]
case 'RFS';
$WHERE = 'WHERE DesigGeneral = "Flower" AND IDParent="usa"
OR DesigGeneral = "Flower" AND IDParent="can"
OR DesigGeneral = "Flower" AND S.IDArea="gum"
OR DesigGeneral = "Flower" AND S.IDArea="mnp"
OR DesigGeneral = "Flower" AND S.IDArea="pri"';
break;
[END SWITCH]
// if type contains content then print out list
$result = mysql_query('select count(*) from symbols');
if (($result) && (mysql_result ($result , 0) > 0)) {
} else {
die('Invalid query: ' . mysql_error());
}
{
$res = mysql_query ("SELECT * FROM symbols AS S
LEFT JOIN famarea AS F ON F.IDArea = S.IDArea
$WHERE
ORDER BY S.NID") or die (mysql_error());
[/PHP]
....where "usa" = United States, "can" = Canada and "gum", "mnp" and
"pri" = Guam, the Northern Marianas and Puerto Rico.
Note that some states have TWO state flowers. These states are
represented by two separate rows in my database table. I have similar
tables for state trees and birds.
Now I want to group all three classes of symbols together in one table.
The table will have four columns - one for the name of the state or
province and three more for flowers, trees and birds.
But since Newfoundland's provincial flower, provincial tree, and TWO
provincial birds are listed on four different rows in my database table,
I need to figure out how to make all these symbols display on two rows.
Looking at it from another angle, every state and province has at least
one official flower, tree and bird. These will all be displayed on one
row. If it has a second official flower OR tree OR bird, it will be
displayed on a second row. If it has a second official flower AND a
second tree AND second bird, they will all be displayed on a second row.
So how can I modify my script so it can do this?
Thanks.
--
http://www.geobop.org/ (Geobop) | http://www.geoworld.org/ (GeoWorld) |
http://www.geozoo.org (GeoZoo) |
http://www.geosymbols.org (GeoSymbols) | http://www.politix.us/ (Kids'
Politix) |
http://geowebworks.geobop.org/ (Ethical Web Design) |
http://www.freedomware.us/ (Open Source Activism)
|