I am passing several zip codes(retrieved by a previous lat/long search) and other data via GET to another page that will retrieve all listings from a database that contains those zip codes in the address.
So the url looks like this:
http://blahblahblah.com/listings.php?date=2015-10-23&zc=0=23547&1=28456&2=27678
My question is how do I loop through those zip codes in my db query? It seem like running a separate query for each zip code would be pretty taxing if given to many zipcodes.
$zc = array(); //initiate the array
$zc[0] = $_POST['zip']; // Add the starting zip code to the array
mysqli_query($conn, "select * zip_code within a certain range of lat and lng");
// return results
while($row = mysqli_fetch_assoc($sql)){
$zip = $row['db_zip'];
array_push($zip);
}
So there is how I am getting the info into the array. After that it is on to building the URL to display a link on a calendar for each day of the month that there is a listing.
//A ton of other stuff then
//echo the link using html_build_query() to add the zips to the get parameters.
echo '<a href="listing.php?date='.$l_date.'&zc='.http_build_query($zc).'">'.$d_count.'</a>';
So then I am on to processing the info on the next page, which is where I am really confused.