Help with mysqldump

Codes here !

Moderators: egami, macek, gesf

Post Reply
kelvin24
New php-forum User
New php-forum User
Posts: 10
Joined: Mon Aug 13, 2012 5:11 pm

Sun Sep 23, 2012 7:32 am

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!

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests