how to add date while importing data in csv from mysql query
Linux, Apache, MySQL, PHP
1
Posts
1
Posters
0
Views
1
Watching
-
need to add date in the file name into outfile caluse below please suggest
SET @outpath = "/var/lib/mysql-files/";
SET @outfile = (SELECT NOW());
SET @outextension = "_StepCount.csv";
SET @SQL := CONCAT("Select Concat(ifnull(First_Name,'')," ",ifnull(Middle_Name,'')," ",ifnull(Last_name,'')) AS Name, u.email from users",@outpath,@outfile,@outextension ) ;
PREPARE stmt FROM @SQL;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;