Jump to content

[SOLVED] displaying rows


jakebur01

Recommended Posts

How do I echo out these rows I am selecting from the zipcode column?

 

function inradius($zip,$radius)
    {
        global $db;
        $query="SELECT * FROM zipData WHERE zipcode='$zip'";
        $db->query($query);

        if($db->affected_rows()<>0) {
            $db->next_record();
            $lat=$db->f("lat");
            $lon=$db->f("lon");
     $query="SELECT zipcode FROM zipData WHERE (POW((69.1*(lon-\"$lon\")*cos($lat/57.3)),\"2\")+POW((69.1*(lat-\"$lat\")),\"2\"))<($radius*$radius) ";
            $db->query($query);
            if($db->affected_rows()<>0) {
                  while($db->next_record()) {
                    $zipArray[$i]=$db->f("zipcode");
                    $i++;
                }
            }
        }else{
            return "Zip Code not found";
        }
return $zipArray;
    } // end func

} // end class

Link to comment
https://forums.phpfreaks.com/topic/46964-solved-displaying-rows/
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.