Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Already tried it, doesn't work as well, the first, the second I'll try it now. Commented Jan 30, 2012 at 11:59
  • I just tried the second method, the same error, that mysqldump is not recognized as an internal or external command. One question though, $backupFile should it have the location as well ? Because I have the location as well. For example the php file that executes it is in the same folder with the folder that I have the $backupFile point to. Commented Jan 30, 2012 at 12:07
  • You need to have location. However you cannot use mysqldump under windows. Do you have a linux server to try? Commented Jan 30, 2012 at 12:12
  • No, but any other operation works fine with XAAMP, why isn't this one working ? And this is a app in development so I won't be able to upload it on server because the code is a mess and I don't have the db there. Commented Jan 30, 2012 at 12:14
  • But then, why cannot I use this ? $backup = 'backup_'.date('Y').'_'.date('m').'_'.date('d').'.sql'; $sql = "BACKUP DATABASE logindb TO DISK = '$location/$backup' WITH FORMAT"; error_reporting(E_ALL); try{ $stmt = $this->connect->prepare($sql); $stmt->execute(); $stmt->close(); } catch(PDOException $e) { echo $e->getMessage(); } It tells me Fatal error: Call to a member function execute() on a non-object in C:\xampp\htdocs\login\assets\class\login\loginsys.php on line 527 that line being $stmt->execute(); , but if I don't use try it outputs an empty file. Commented Jan 30, 2012 at 12:16