Jump to content


Photo

why my sqldump returns a blank file... sigh~~


  • Please log in to reply
No replies to this topic

#1 baby_lion

baby_lion
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 22 November 2005 - 03:31 AM

I am all confused here. My code write as such;
#!/usr/local/bin/php -q
<?php

set_time_limit(0); 

$DB_HOST = "localhost";
$DB_USERNAME = "";
$DB_PASSWORD = "";
$DB_NAME = "someDb"; 

$LOCAL_DUMP_PATH = "C:/apache/htdocs/";   
$FILENAME_PREFFIX = "sqldump";           

$filename = $FILENAME_PREFFIX.date("YmdHis").".sql";
 
$dump_cmd = "mysqldump -h$DB_HOST -u$DB_USERNAME -p$DB_PASSWORD";

if ($DB_NAME == "all" || $DB_NAME = "ALL") {
  $dump_cmd .= " --all-databases";
} else {
  $dump_cmd = " $DB_NAME";
}

$dump_cmd .= " > $LOCAL_DUMP_PATH$filename"; 
exec($dump_cmd); 

echo "Data has been backed up!!!";
?>

This code certainly creates the file, but the files were blank! Please anyone xplain this to me...thanks..
btw, I'm using phpmyadmin 2.5.0..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users