Hi Simon, On Saturday 13 September 2003 19:01, Simon Stiefel wrote: > On 13 Sep 2003 at 17:26, James Hatridge wrote: > > HI gang! > > Hi! > > > I am trying to do a mysql update. I wrote a small bash file that works > > fine at the command line. But I would like to have it ran by PHP whenever > > I start the DB. What I am trying to do is have PHP check if a new update > > file is there (AUD.txt) if it is run the "euro-update.program". But I'm > > getting either nothing or errors. see below.... > > > > ####################### > > > > Here is the piece of code that is making this error: > > > > <?php > > > > $db = mysql_connect("XXX", "YYYYYY", "ZZZZZ"); > > mysql_select_db("WartHog",$db); > > > > if (file_exists("/var/lib/mysql/WartHog/AUD.txt")){ > > > > exec(`/var/lib/mysql/WartHog/euro-update.program`) > > Here's the problem. > Your euro-update.program is already executed through the inverted > commas. > And then the exec-function tries to execute the return value from > your program. And so you get the exec-warning, cause it doesn't know > what to execute. > > > or die ('didnt work #1') ; > > } > > else > > { > > echo('File not there'); > > } > > > > ?> > > ############################# > > > > Running the code as is I get this error: > > > > Warning: exec() [function.exec]: Cannot execute a blank command in > > /home/hatridge/public_html/Database/currency.php on line 22 > > > > ##################### > > > > When I use " " or ' ' around the program name I get only "didn't work > > #1". > > Then you perhaps don't have the right to execute it. > Note that the apache-user must have the execution right on that file. This sounds like maybe the problem. Now how can I fix it? BTW I have apache etc all on one system without access to the net. I only use the system for business ie DB, letter writing, billing etc. Thanks JIM > > > Any ideas? > > Yes, see above. ;) > > > Thanks! > > > > JIM > > HTH, > > Simon -- Jim Hatridge Linux User #88484 ------------------------------------------------------ BayerWulf Linux System # 129656 The Recycled Beowulf Project Looking for throw-away or obsolete computers and parts to recycle into a Linux super computer Viel Feind -- Viel Ehr' Anti-US Propaganda stamp collecton http://www.fuzzybunnymilitia.org/~hatridge/collection -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php