Re: mysqldump

From: Date: Wed, 10 Nov 2004 02:31:47 +0000
Subject: Re: mysqldump
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-37213@lists.php.net to get a copy of this message
On Tuesday 09 November 2004 17:59, Aaron Todd wrote: > I have created a PHP script that looks like: > > <?php > $filename = "/var/www/html/db_backup_" . date("n-j-y").".sql"; > exec('mysqldump -u ***** -p***** database > $filename'); > ?> > > For some reason this doesnt work and I cant figure out why. There is no > error that comes back. When I run the mysqldump command from the server > console it produces the file fine. I have read a few other posts out there > about this same thing which resulted in the location the file was being > saved. But I have gone through my server and found nothing. Does anyone > have any suggestions for regarding this. Try using double quotes. Also just like performing SQL queries, it's a very good idea to build up the command you want executed, store it in a string ($cmd), then echo it to see whether it looks good, then exec($cmd). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db ------------------------------------------ /* Save the bales! */

« previous php.db (#37213) next »