I have been looking into the user guide which came with CodeIgniter. I became very interested with the dbutil()
method. Particularly the following line of code:
Try this!
$username = "root";
$password = "root";
$hostname = "localhost";
$dbname = "raas";
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($dbname . "_" .date("Y-m-d_H-i-s").".sql"));
$command = "C:\AppServ\MySQL\bin\mysqldump --add-drop-table --host=$hostname --user=$username --password=$password ".$dbname;
system($command);