Just an FYI I am not a PHP Programmer so if there is a syntactial error in your PHP code I will not pick up on it; I do understand what your code is trying to do though.
Have you done this:
echo $name_query
Inside your town area block to see what your sql statements are equating to? I would start there as it is likely the values you *think* are being passed in actually are not.
HTH.
================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile
================================================== =========