Not sure why but I am not getting anything back from the json call. I echo’ed the content out and pasted to my url bar of my browser and it works. Is there some sort of domain problem here that I need to address?
$connect = open_db();
$result = mysql_query("SELECT search_id, search_term FROM search WHERE search_poi_id IS NULL");
while($row = mysql_fetch_assoc($result)){
$call = "http://maps.google.com/maps/api/geocode/json?address=".$row["search_term"]."&sensor=false";
$json = file_get_contents($call);
print_r($json);
}
close_db($connect);
file_get_contents()may not always work for external URLs. From php.net: