Ok, so is it possible to combine these two types of data displays.
This si what I need to do. in my database, there is a record that has an area, city, state, region and URL. I want to display the data, by state, then city and build the link from each city dynamically using the URL field. I was able to do something very simple by using this:
while ($myrow = mysql_fetch_row($result)) {
printf("<th><font size=3><a href=\"http://%s" target=\"_blank\">%s </a></font></th>\n",
$myrow[0], $myrow[0]) ;
this creates a nice long list or URL's. no problem.
but now i want to break it down by state, then each city under that state would have a single link. (IE)
CA
www.losangeles.com
www.sandiego.com
NH
www.concord.com
www.nashua.com
etc
I took a different approach and the following code is almost working
while ($row = mysql_fetch_assoc($result)) {$array[$row['state']][] = $row['city'];}
foreach ($array as $key => $value)
{
echo '<tr>' . $key . '/td>;
foreach ($value as $city) {echo '<a href="http://' . $URL . '" target="_blank"> ' . $city . ',' . $state . '</a><br>';}
But the $URL field is not getting filled in because its not grabbing it from the DB. All the other fields get passed into the page from the GET.
so, what happens is the the href link gets created without the URL in it.
So, is there a way to do this?