David,
Are both of these issues spurring from the same query? It looks that way, but I don't want to assume.
One of things I would do is make sure that query is really valid and is supplying a value. Maybe go to the top of the page just below the query and use the echo command for debugging purposes. Have it echo those two values from the query before you try to store them into variables. It will probably crash the page but should show exactly - if at all - what the values of each binding are.
If the values are there, then you may have something else wrong with your code. Perhaps and if statement that is keeping code from running the way you want... it really could be anything. If you want to post your code (or you could email it to me if it contains sensitive coding you don't want to share here), I will take a look at it. My email address is sojoweb(at)rocketmail.com.
Cheers,
Brian