Hi,
Does anyone know of a code which will export my database into a .zip or .txt anything and email it to me???
The reason i want this is so the i can automaticly backup my database each week
if you are using mySQL on a Unix/Linux server then you can run a weekly cron job that runs mysqldump and then sends you the resulting backup via [man]mail[/man].
Just 1 point, if your db is large then the backup file could easily be too big for an email attachment: many smtp servers will not relay files over a certain size.
Yeah, it's better to put it behind a .htaccess protected directory on a web server and send an url along...
Or automate wget or rsync on your local machine to grab the dump file.
Heck, program a PHP script on the database host to fopen an [url]ftp://[/url] url to your home box and just stuff it right in there at 2:00am...