PHP Array Help Needed!!!

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
im talking about 40k + zip codes...

a where clause such as so would e too much wear on the database of that size
 
0
Close
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
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back