Wow, that’s pretty cool; I didn’t know there was a way to escape while loops.
One weird problem, though. For some reason, it seems to ignore my database query constraints and suck everything out of the table it can. This is what it should display:
Big Cypress National Preserve | Biscayne National Park | Canaveral National Seashore | Dry Tortugas National Park | Everglades National Park | Gulf Islands National Seashore | Timucuan Ecological and Historic Preserve
But this is the actual display:
Big Cypress National Preserve | Biscayne National Park | Canaveral National Seashore | Dry Tortugas National Park | Everglades National Park | Gulf Islands National Seashore | Timucuan Ecological and Historic Preserve | Archie Carr National Wildlife Refuge // Osceola National Forest | |Osceola National Forest | | Arthur R. Marshall Loxahatchee National Wildlife Refuge // [etc.] // Osceola National Forest | |Array
I don’t know where these come from… | |, //
I checked my code in phpMyAdmin, and it seems to work just fine, displaying only Florida national parks…
$result = mysql_query('select count(*) from gw_protected_areas_usa');
if (($result) && (mysql_result ($result , 0) > 0)) {
} else {
die('Invalid query: ' . mysql_error());
}
{
$res = mysql_query ("SELECT GWP.ID, GWP.IDArea, GWP.Name, GWP.URL, GWP.Category, GWP.Type
FROM gw_protected_areas_usa GWP
WHERE GWP.IDArea = '$MyID'
AND GWP.Category != 'Cul' AND GWP.Parent = 'NPS'") or die (mysql_error());
echo '<p class="pflat"><b>National Parks, Monuments, etc.</b> – ';
{
while ($row = mysql_fetch_array ($res)) {
$ID = $row['ID'];
$IDArea = $row['IDArea'];
$Names[] = $row['Name'];
echo join( $Names, ' | ' );
$URL = $row['URL'];
$Cat = $row['Category'];
$Type = $row['Type'];
}
}
}
echo $Names;
echo '</p>';
Any idea what’s going on?
P.S. Lemon Juice, I tried your solution, too, but it isn’t working for me yet. I’ll play with it some more.
Thanks for all the tips.