Hi,
I am trying to backup one of my Mysql database with a PHP script.
<?php
$host="localhost";
$database="toy";
$username="root";
$password="";
$connection=mysql_connect($host, $username, $password);
if(!$connection) {
die("ERROR: Couldn't connect to the server.");
} else {
$dbSelect=mysql_select_db($database);
if(!$dbSelect) {
die("ERROR: Couldn't select the database.");
} else {
$mysqldumpPath="/usr/bin/mysqldump";
$backupFileName = "Desktop/toy-`date +%d-%m-%Y-%H:%M:%S`.sql";
$createBackup = $mysqldumpPath." -u ".$username." -h ".$host." ".$database." > ".$backupFileName;
exec($createBackup);
}
}
?>
Executed code works fine in Linux terminal (toy-10-09-2009-16:15:49.sql) but when i run this PHP script it doesn't work. No error too.
What do you think i miss?
Thanks