How would I go about having my sql query results exported to a .csv file? The goal is to automate this process, the query would pull records from the previous day and then export them to a directory of my choosing. If possible, I'd even like to have the date added to the filename so it doesn't automatically overwrite the previous day's results.
here is the query :
SELECT g.id, g.name, g.date, g.date_mod, g.status, cree_par, modifier_par
FROM glpi_tickets g , (select id, concat(realname , ' ' , firstname)
cree_par from glpi_users ) c, (select id, concat(realname , ' ' ,
firstname) modifier_par from glpi_users) m
where users_id_recipient <> users_id_lastupdater
and users_id_recipient = c.id
and users_id_lastupdater = m.id;