Change this line:
$backupdir = 'C:\wampbackup\x.sql';
into:
$backupdir = 'C:\\wampbackup\\x.sql';
You need to escape back-slashes with another \
back-slash. :)
Sarfraz
2010-02-20 08:21:12
Change this line:
$backupdir = 'C:\wampbackup\x.sql';
into:
$backupdir = 'C:\\wampbackup\\x.sql';
You need to escape back-slashes with another \
back-slash. :)
You should actually post your error message along with your code. But if it is not a copy-paste error, I found your bug: It's on line 4, the closing apostrophe is missing
$db= 'hospital;
As a minor aside, you could skip the entirety of
if ($day < 10) {
$day = "0$day";
}
Later on you're using those values in a sprintf() call, which can do such formatting automatically. Simply change the matching %s
with %02d
(print a d
ecimal padded to 2
spaces with the 0
character).