public function back() { $dbhost = 'localhost:3036'; $dbuser = 'root'; $dbpass = ''; $dbname = 'tawrny_dr'; $backup_file = $dbname . date("Y-m-d-H-i-s") . '.sql'; //DO NOT EDIT BELOW THIS LINE //Export the database and output the status to the page $command = 'mysqldump --opt -h' . $dbhost . ' -u' . $dbuser . ' -p' . $dbpass . ' ' . $dbname . ' > ~/' . $backup_file; exec($command, $output = array(), $worked); switch ($worked) { case 0: echo 'Database <b>' . $dbname . '</b> successfully exported to <b>~/' . $backup_file . '</b>'; break; case 1: echo 'There was a warning during the export of <b>' . $dbname . '</b> to <b>~/' . $backup_file . '</b>'; break; case 2: echo 'There was an error during export. Please check your values:<br/><br/><table><tr><td>MySQL Database Name:</td><td><b>' . $dbname . '</b></td></tr><tr><td>MySQL User Name:</td><td><b>' . $dbname . '</b></td></tr><tr><td>MySQL Password:</td><td><b>NOTSHOWN</b></td></tr><tr><td>MySQL Host Name:</td><td><b>' . $dbhost . '</b></td></tr></table>'; break; } die(); }
ERROR: Exec is not available!!!"
Execute
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)