Hello,
The Views filter for Proximity/Location does not seem to work when I try to return a PHP array as an argument. I try the following code and it works fine:
$coordinates = array ('latitude' => '27.997276', 'longitude' => '-81.745540');
print_r($coordinates);
I then try the code below, to pull a postal code from a cookie and return lat/long values from the zipcodes database:
$cke = $_COOKIE['ZIP'];
$sql = "SELECT latitude,longitude FROM zipcodes WHERE zip = $cke";
$data = db_query($sql);
while ($item = db_fetch_array($data)) {
print_r($item);
}
This codes works fine if I use it outside of views - both sets of code return exactly the same values in the same PHP type, in an array. But for some reason the second set of code does not work in the view - is it because I can't use a "db_query" in this filter? If so, how do I make this work? Thanks!!!
Comments
Comment #1
jaynhook commentedComment #2
jaynhook commentedReplaced "print_r($item)" with "return $item". Sorry!