its been forever and a day since i used php ... so be kind and rewind.
i have 2 queries. the second relying on the results of the first. i want to pull data in the second depending on what the 'cname' is of the first query.
how do i go about doing this.... i am being really stupid.
php
//first query
$query = "SELECT id, cname, csubhead, caddress, chours, ccontact, coverview, curate, cunumrate, cyamrate, cweb, cglat, cglong, cstores, cgzoom FROM shopcenter WHERE id=2";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// if records present
if (mysql_num_rows($result) > 0)
{
// iterate through resultset
// print article titles
while($row = mysql_fetch_object($result))
{
//second query
$query2 = "SELECT id, sname, stype1, scenter1 FROM stores WHERE scenter1 = $row-> cname ORDER BY sname";
$result2 = mysql_query($query2) or die ("Error in query: $query. " . mysql_error());