- Code: Select all
<?php
$dbhost = "localhost";
$dbuser = "root";
$dbpwd = "kelvin";
$dbname = "softeng";
date_default_timezone_set('Asia/Brunei');
$dumpfile = $dbname . "_" . date("Y-m-d_H-i-s") . ".sql";
passthru("/usr/bin/mysqldump --opt --host=$dbhost --user=$dbuser --password=$dbpwd $dbname > $dumpfile");
// report - disable with // if not needed
// must look like "-- Dump completed on ..."
echo "$dumpfile "; passthru("tail -1 $dumpfile");
?>
I've got this code from this tutorial http://www.tutorialspoint.com/php/perfo ... up_php.htm
and by some reason its not working on me. Its not creating a backup...someone pls help!

