Re: [nyphp-talk] Help with error statement

2006-11-16 Thread Paul
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

Re: [nyphp-talk] Help with error statement

2006-11-16 Thread Rob Marscher
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

Re: [nyphp-talk] Help with error statement

2006-11-16 Thread Paul
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

Re: [nyphp-talk] Help with error statement

2006-11-16 Thread Rob Marscher
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

Re: [nyphp-talk] Help with error statement

2006-11-16 Thread Paul
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

Re: [nyphp-talk] Help with error statement

2006-11-16 Thread Rob Marscher
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

[nyphp-talk] Help with error statement

2006-11-16 Thread Paul
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