Code: Select all
<?php
$Path="C:\phpdev3\mysql3.23\bin";
$MySQLServer="localhost";
$MySQLUser="";
$MySQLPassword="";
$DBName="test";
$StorePath="C:\mysqlbackup\20030208"
$Command=$Path. "". "mysqldump -h".$MySQLServer." -u".$MySQLUser." -p".$MySQLPassword." --add-drop-table ".$DBName." > ".$StorePath. "" .$DBName.".sql";
passthru($Command,$result);
if ($result)
{
echo "<br>Error! Database $DBName Not Backed Up";
}
else
{
echo "Backup Successfull";
}
?>when i comment the passthru statement then ok... i gave an echo statement to print the variable 'Command'
it printed the following:
c:\phpdev3\mysql3.23\bin\mysqldump -hlocalhost -u -p --add-drop-table test > c:\mysqlbackup\20030208\test.sql
i also tried with 'system' command...but nothing works..
when i typed the same thing in command prompt it works fine...
is there any thing i am missing out...
i am using win98/apache/mysql3.23/php 4