Unstoppable Domains

PHP Array Help Needed!!!

Spaceship Spaceship
Watch

Ray

VIP Member
Impact
167
I am having a little trouble coding tonight.. I need some help .. lol


Basically, I want to take the contents from the $zip and make it one long array so i can search a mysql database for the all businesses located in the zips. this script locates all the zips in a certain distance and lists them. I want it to search a database and output the businesses how would i do so.





<?php

require_once('zipcode.class.php');

---Mysql-- //left out for safety

$szip="19044";
$sdis="5";


$z = new zipcode_class;
$zips = $z->get_zips_in_range($szip, $sdis, _ZIPS_SORT_BY_DISTANCE_ASC, true);


if ($zips === false) echo 'Error: '.$z->last_error;
else {

foreach ($zips as $key => $value) {

/

}


}
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
how many zipe are you talking about?

why not just place them all in a where clause such as

select * from business where zip = $zip1 OR zip = $zip2 etc
 
0
•••
im talking about 40k + zip codes...

a where clause such as so would e too much wear on the database of that size
 
0
•••
Why is there 40k zips. What sort of distance are you looking at from the original location?

Just had a look and there is about 43k zips in the US so if you want to list all from 40k zips you are not far off listing the whole of the database of US business.
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back