This is a complement to my resolved question here:
how to get an array of zip codes within x miles in perl
Ok, I have an @zips array. Now I'm trying to use it in a query like this:
SELECT `club_name`,`city` FROM `table` WHERE `public_gig` = 'y' AND `zip` IN (@zips)
But I can’t make it work. (I use placeholders and, as you see in my link above.)
I managed to get this to work:
$fzip=shift(@Zips);
$lzip=pop(@Zips);
SELECT `club_name`,`city` FROM `table` WHERE `public_gig` = 'y' AND `zip` BETWEEN $fzip AND $lzip
ZIP | public_gig | start_time | fin_time | city | club_name | and so on
33416 | y | 9pm | 2am | clearwater | beach bar | yada
But for obvious reasons and some similarities with accuracy, this is not quite what I want. Just wanted to see if I could ANYTHING work on my own.
Why can't I get the request to work with zip arrays in the array using IN? Nothing is returned and there is no error.
Actually, there is much more to this request, but I left everything to save it here.
. , .
.