You could use SQL for this:
$file = 'backups/mytable.sql';
$result = mysql_query("SELECT * INTO OUTFILE '$file' FROM `##table##`");
Then just point a browser or FTP client at the directory/file (backups/mytable.sql). This is also a nice way to do incremental backups, given the filename a timestamp for example.
To get it back in to your DataBase from that file you can use:
$file = 'backups/mytable.sql';
$result = mysql_query("LOAD DATA INFILE '$file' INTO TABLE `##table##`");
The other option is to use PHP to invoke a system command on the server and run 'mysqldump':
$file = 'backups/mytable.sql';
system("mysqldump --opt -h ##databaseserver## -u ##username## -p ##password## ##database | gzip > ".$file);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…