simple php mysql dump

<?php $DBUSER="user"; $DBPASSWD="password"; $DATABASE="user_db"; $filename = "backup-" . date("d-m-Y") . ".sql.gz"; $mime = "application/x-gzip"; header( "Content-Type: " . $mime ); header( 'Content-Disposition: attachment; filename="' . $filename . '"' ); $cmd = "mysqldump -u $DBUSER --password=$DBPASSWD $DATABASE | gzip --best"; passthru( $cmd ); exit(0); ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.