in reply to Query database

I don't understand what could be the problem
In this particular case it wouldn't have helped, but in many many others, use strict (which you have commented out) will complain about such things, and save you a lot of time and frustration.