Hmm... Did not think that this would be that difficult. Though I
know I looked at it for several day before posting here. Sorry for
all posts. The last solution did not work either. There is an if
statement but no else. Sorry I am unsure where it would go. Also
for some reason the chan
Gotcha. Try this:
$zips = $z->get_zips_in_range('07732', '10',
_ZIPS_SORT_BY_DISTANCE_ASC, true);
$row_count++;
foreach ($zips as $key => $value)
{
//find all locations within range using returned zipcode values
$sql_events = mysql_query("SELECT * FROM area36 WHERE zipcode
='$key'") o
The problem with this is that the count is always greater than zero.
The count($key) will always equal at least one. The one being the
orignating zipcode that you searched since even if you searched 1
mile, you would still have one originating zipcode. If there is a
location at that orig
Sorry... I looked at it a little too quickly... You need to put your if
statement outside the foreach. That was the issue.
$zips = $z->get_zips_in_range('07732', '10', _ZIPS_SORT_BY_DISTANCE_ASC, true);
if(isset($zips) && count($key) > 0)
//find all locations within range using returned zipcode
If I do as I think you suggested here:
On Nov 16, 2006, at 11:35 AM, Rob Marscher wrote:
> You want to use mysql_num_rows -
> http://us3.php.net/manual/en/function.mysql-num-rows.php - after your
> query. You can then do an if statement to check if mysql_num_rows !
> = 0
> before doing the while
You want to use mysql_num_rows -
http://us3.php.net/manual/en/function.mysql-num-rows.php - after your
query. You can then do an if statement to check if mysql_num_rows != 0
before doing the while loop:
$sql_events = mysql_query("SELECT * FROM area36 WHERE zipcode
='$key'") or die (mysql_err
I have the start of a zipcode radius locator. It seems to work but
the problem I am having is creating an error statement if no
locations are found. At first it made sense to check for retuned
zipcode values. The problem being one zipcode will always be
returned the one that is used for