outfile naming problem.

wxdqz

New Member
I'm using the following code to send a mysql db to a txt file:

mysql_query("SELECT if(isnull(first_name), ' ', first_name), if(isnull(last_name), ' ', last_name),if(isnull(company), ' ', company), if(isnull(phone), ' ', phone), if(isnull(fax), ' ', fax) from members WHERE phone IS NOT NULL OR fax IS NOT NULL INTO OUTFILE '/usr/local/etc/httpd/vhosts/mysql/outfile.txt FIELDS TERMINATED BY '|'");

I'm aware that there isn't a way to overright an existing outfile. So what or how can I replace outfile.txt in the above example with a unique name different everytime it's executed. For instance naming it the current date and time.txt.

Thanks,

Chad
 
Back
Top