Jump to content

Help Needed With Simple Query


barryflood22

Recommended Posts

i have two tables cross referencing each other but for some reason it wont populate the "country" results, below is my code, can anyone help?

 

 <?php
//ECHO LOCATION 
echo '<p><b>Location: </b>';
   // get area details
   $query2="select * from jos_RAM_areas WHERE id = '".$row['area']."' ";
   $sth2=mysql_query($query);
   $num_rows2 = count($sth2);
   // record found?
   if ($num_rows2>0) {
 $row2=$sth2[0]; // get the record details (now in an array)
 $Country=$row2['Country'];
 $County=$row2['County'];
 if ($County!='') { $Area = "$Country, $County"; } else { $Area = "$Country"; }
   } else {

   } // eof check for record found
   echo $Area;
   $town_city = $row['town_city'];
   if ($town_city!='') { echo "$country\n\n$town_city"; }




 ?>

Link to comment
https://forums.phpfreaks.com/topic/269778-help-needed-with-simple-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.