Re: I'm prepared to feel like an idiot... But I just simply need the answer :)

From: Date: Wed, 01 Aug 2007 13:42:12 +0000
Subject: Re: I'm prepared to feel like an idiot... But I just simply need the answer :)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-259992@lists.php.net to get a copy of this message
On Aug 1, 2007, at 9:37 AM, Thijs Lensselink wrote:
On Wed, 1 Aug 2007 08:49:34 -0400, Jason Pruim <japruim@raoset.com> wrote:
Hi All :) I have a php script that I am attempting to run from the CLI to connect to a MySQL database and update a field. but when I run it with this command: php cronjob.php it prints out the script on screen but doesn't process it... Running: php-r"phpinfo();" prints out the standard phpinfo screen.. and I don't think I should have to write it differently to make it run from the command line right? HELP! I'm desperate... I would offer to name my first born after you... But he's already been born :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com
Maybe you can show use some code?
@mysql_connect('localhost', 'user', 'password') or die("Cannot connect to DB!" . mysql_error()); @mysql_select_db('ticklers') or die("Cannot select DB!" . mysql_error()); $sql="UPDATE tasks SET completed='0'"; mysql_query($sql); also when looking at the code, I noticed that I didn't have the opening and closing php tags ... Now I do and I'm getting an error :) cannot connect to DB!Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)qs:/volumes/raider/webserver/documents/tests/ticklers japruim$ This is only from the commandline... running the script straight in a browser doesn't show any errors... and it works just fine. -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com

« previous php.general (#259992) next »