I want to export a single table into an SQL file for backup every day using cron-job.
I've looked around for some scripts bust most were not so user-friendly.
I've seen this: http://help.1and1.com/hosting-c37630/linux-c85098/php-c37728/importing-and-exporting-mysql-databases-using-php-a595887.html
But it exports the whole DB (which weighs about 10GBs), I need to export a single 16mb table.
The preferred method is for it to look like a normal sql file (like the ones Phpmyadmin exports), something like this:
CREATE TABLE IF NOT EXISTS `parts` (
`flag` char(1) NOT NULL DEFAULT '',
`comp` int(10) NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL DEFAULT '',
`rname` varchar(255) NOT NULL DEFAULT '',
`hname` varchar(255) NOT NULL DEFAULT '',