Could also be the env variables set by the httpd.conf file while they are not set when the script runs by the crontab, try running it with the command line and see if it gives you any errors.
I did have the problem with the sql scripts running with the apache until I defined all the env variables in the httpd.conf and the script itself. Regards, Ebaad. ----- Original Message ----- From: "David Gerler" <[EMAIL PROTECTED]> To: "Thanatos" <[EMAIL PROTECTED]> Cc: "Beginners" <[EMAIL PROTECTED]> Sent: Sunday, September 08, 2002 12:02 PM Subject: RE: Problems with perl and cron jobs > > > David Gerler wrote: > > > Hi all, > > > I have a script that runs an SQL query and sends an email > > using sendmail. > > > It works fine if called using a browser. The email is sent with > > the correct > > > content in the message. > > > If I run it using cron, I get the message but the content > > is not sent. > > > Meaning the body of the message is empty. I also get an email > > from cron that > > > contains and error message: > > > ----------- > > > DBD::mysql::db do failed: You have an error in your SQL syntax > > near '' at > > > line 1 at /home/ezbid/www/cgi-bin/ua/includes/close_item.pl line 248. > > > ---------- > > > > > > Can anybody give me some insight as to why I get an error when cron > > > executes the script, but when I do it in a browser it works fine. > > > > > > Any help is appreciated. > > > > > > David Gerler > > > Gerler Enterprises > > > PO BOX 16357 > > > Chesapeake VA 23328 > > > http://www.GerlerEnterprises.com/ > > > > > > Nationwide Dial-up from $12.45 > > > http://www.EasySitesForLess.com/ > > > > > > > > > > > > > > > > I ( we ) would need to see the script(s) that cron is calling to help > > out. However, I get that DBD error all the time :-) .. are you sure your > > sql statement is correct? > > > > Thanatos > > > The script runs when called from a browser so I was thinking that it had to > do with the differences in how apache and cron worked or something like > that, so I didn't include the code. I will include the code below: > > This is the sql statement from line 248: > $db->do("UPDATE Members SET won=won + 1 WHERE usernum=$biddernum"); > > This is the job I set in cronjobs: > * * * * * /home/ezbid/www/cgi-bin/ua/item.pl?item=958 > /dev/null > > I'm new to SQL also, so could the spaces around the "+" be the problem? > > Dave > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]