Yes, you need to test this independent of the cron job, and once its working go back and implement the cron job.
Just make it into a php file, go to it in browser, and then check your DB for the changes. Fix until you see the changes you are supposed to see. Check yoru error_log file in root to see whats happening.
The folks above are right, your current implementation is incomplete. It never actually executes the sql. Google for PDO examples.