jakebur01 Posted April 14, 2007 Share Posted April 14, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/46964-solved-displaying-rows/ Share on other sites More sharing options...
jakebur01 Posted April 14, 2007 Author Share Posted April 14, 2007 bump Quote Link to comment https://forums.phpfreaks.com/topic/46964-solved-displaying-rows/#findComment-229037 Share on other sites More sharing options...
jakebur01 Posted April 14, 2007 Author Share Posted April 14, 2007 Should I be using mysql_query() and mysql_fetch_array()? I know this is something really small. All i'm trying to do is get the rows from that zip code column after the calculation has been made. Quote Link to comment https://forums.phpfreaks.com/topic/46964-solved-displaying-rows/#findComment-229061 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.