Thanks Ronald, you nailed it!
Not more than an hour ago I saw the err of my ways (with help from a buddy). Our code looks just like yours with slightly different var names. Now I'm on to the next phase...
I'm learning all the time & really enjoying PHP!
MegaThanks for your help!
Karl
User Profile
Collapse
-
Hi Ronald-
my echo is just
Code:echo $zcodes;
Here's what I'm working with as of now:
Code:{ $z = new zipcode_class; $zips = $z->get_zips_in_range($_POST["zip1"], $_POST["radius"], _ZIPS_SORT_BY_DISTANCE_ASC, true); if ($zips === false) echo 'Error: '.$z->last_error; else { $vzips=0; foreach ($zips
Leave a comment:
-
Can we bounce this one? I re-started it under a more descriptive title.
Thanks,
KarlLeave a comment:
-
How to use associative array in WHERE clause
(I started this under an improper title, will request bounce of the other)
Hello All-
I'm new to php. I'm working on using a zip code class I found in order to create a locater app using 2 tables in a db, one is US zip codes with lat & log info and the other table is company info with a zip code field.
The output I'm working with is an associative array with zip codes and the distance from the originating zip code they are.... -
I'm gonna try that... After iterating through the first array with
Code:foreach ($zips as $key => value)
926299262492693 926779267592673 926079267492672
into one that looks like
92629,92624,926 93,92677,92675, 92673,92607,926 74,92672
so it can be used in a WHERE clause.
I've been reading & trying diffrent things, no success yet.
Any suggestio...Leave a comment:
-
Can I make the string ($key) an array to use in a query, maybe?
KarlLeave a comment:
-
Kinda new/part-time with php, learning every time I sit down with it, please excuse my ignorance.
OK, I guess I'm on the wrong path. I'll detail things a little...
I'm using a class for querying a single table zip code db. I'm adding a table of companies and making a company locator based on range from originating zip code.
I have
Code:$z = new zipcode_class; $zips = $z->get_zips_in_range($_POST["zip1"],
Leave a comment:
-
implode an array for query condition
Hi All,
I'm newish to php & have an issue on a project I'm working on...
I've an array containing zip codes which displays if I echo it like
Code:echo "$key";
I need to implode/explode with commas so it passes like 92629,92624,926 93,92677,92675, 92673,92607,926 74,92672 so I can use it as a WHERE IN condition.
...
No activity results to display
Show More
Leave a comment: