Topic awaiting preservation: Beating a dead horse: ZIP code radius search |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: Ward 1 |
posted 11-25-2004 18:49
I stumbled into these forum via a Google search for a project I'm working on. The idea is that someone can type in their zip code and get a list of restaurants within X number of miles. There's a thread on it http://www.ozoneasylum.com/21687 here and a GREAT FAQ here http://www.ozoneasylum.com/21781 for reference. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 11-25-2004 19:40
I think the issue was the while loop if there are no results. |
Maniac (V) Inmate From: Sthlm, Sweden |
posted 11-25-2004 20:27
Hi there, I'm the guilty one to the code in the FAQ... code: function doQueryResult($sql){
|
Paranoid (IV) Inmate From: France |
posted 11-25-2004 20:40 |
Nervous Wreck (II) Inmate From: Ward 1 |
posted 11-25-2004 22:26
Sorry guys but it doesn't work. The line in question was in the faq just the way it's presented here. code: $result = mysql_query($sql,$connection);
quote:
code: while($item = mysql_fetch_array($result)){
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 11-25-2004 22:30
Just take this line code: while($item = mysql_fetch_array($result)){
code: if ($result) {
|
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 11-25-2004 22:40
yeah, php 5 has that. Don't ask me how slow it is, though. |
Maniac (V) Inmate From: Sthlm, Sweden |
posted 11-25-2004 23:06
Ok, I've edited the post as poi suggested. code: $result = mysql_query($sql,$connection) or die(mysql_error());
|