First of all, the .sql extension is not so correct, what you get with SELECT ... INTO OUTFILE is a comma (or other delimiter) delimited text file, not an SQL statements file. It's more a code readability issue but better name your file ad file.txt or file.csv (if delimiters are CSV-compliant).
That said, if you import back your files with 
LOAD DATA LOCAL INFILE '/path/to/file.txt' INTO TABLE your-table-name;`
the backup/import should work but PROVIDED you create the table at first with a CREATE TABLE.
So this leaves you the burden to recreate the schema code-wise, very painful. It is ok if you use already have the schema (f. ex. exporting/importing into the very same database).
Another try if you have 
exec permissions is to use 
mysqldump. For Linux systems it should be:
exec("/usr/bin/mysqldump -uusername-ppassword databasename | gzip -9 > /path/to/backupfile.gz");
to backup the whole db, with additional benefit of GZIP compression. To backup a specific table just add its name next to databasename.