Newbie Question: mysqldump via PHP

From: Date: Tue, 04 Sep 2001 17:55:59 +0000
Subject: Newbie Question: mysqldump via PHP
Groups: php.general 
Request: Send a blank email to php-general+get-65912@lists.php.net to get a copy of this message
Hello listers I'm trying to implement a mySQL database dump via PHP4 on a unix system as follows... ------------------------------------------------------ $result = exec("mysqldump -umyname --password=mypassword tablename >db.dump",$xarray,$status); echo "status[$status]<br>"; ------------------------------------------------------ I get the following error PHP error message... status[127] and the file 'db.dump' has been created but it has 0 bytes. -rw-r--r-- 1 nobody nobody 0 Sep 4 13:27 db.dump Although I can execute the mysqldump program from the unix shell and I get... -rw-r--r-- 1 myname myname 23704 Sep 4 13:18 db.dump My questions are... 1. Can the mysqldump program be executed via PHP or not and if not can you please explain why? 2. Is there another way of doing this via PHP? Thanks in advance Tony Frasketi P.S. Please answer direct, since I'm only subscribed to the digest.

« previous php.general (#65912) next »