well, from cron, you'd need to have an additional CGI installation of PHP, or write a perl script to exec your DB queries from the shell.
One trick I use all the time on all my HTTP production sites is that I send a request to cUrl (http://curl.haxx.se) via a shell command, which then can access it's own little page to work from. Basically, your own web bot to go around performing tasks via a browser interface.
A bit more advanced, but it's kind of cool, considering you can have it post, login via an HTTP_AUTH and just about anything else you'd need... it can also have it's own sessions (cookies even!) and act like a normal user.
Kind of handy if you'd like to have a spider that can crawl your site and ensure that things work.
Also, it allows itself to be more secure than even you, since it can send it's own USER_AGENT which of course you can set very easily... so that page wont even respond to a USER_AGENT that isn't say:
Mozilla/4.0 (compatible; SATAN_BOTv1.1😉
even if it passed an HTTP_AUTH
and can perform SSL transactions over HTTPS.
All that was a bit more than what you need
but, it gives you an idea of how far out there you can get with cUrl and cron and some basic PHP.
And cUrl is just damn cool anyway, there are a bunch of built in PHP functions for it, which you may find very handy as well as just invoking it from a commandline.