[SOLVED]How do you get_dir_file_info date into mysql? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: [SOLVED]How do you get_dir_file_info date into mysql? (/showthread.php?tid=19022) |
[SOLVED]How do you get_dir_file_info date into mysql? - El Forum - 05-25-2009 [eluser]zimco[/eluser] get_dir_file_info('path/to/directory/') returns an array with the following file info for each file in a directory: Quote:name The files date info seems to be returned in unix time. So how do you store a unix time in a mysql database? I've tried creating a table like the following: Code: DROP TABLE IF EXISTS `mydir_fileslist`; [SOLVED]How do you get_dir_file_info date into mysql? - El Forum - 05-25-2009 [eluser]Yorick Peterse[/eluser] Rather than using a "timestamp", use "Unix_Timestamp" and set the default value to nothing. [SOLVED]How do you get_dir_file_info date into mysql? - El Forum - 05-25-2009 [eluser]zimco[/eluser] Tried your suggestion like this: Code: DROP TABLE IF EXISTS `html_racefiles`; and it errors out with: Quote:#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unix_timestamp, Any other suggestions? [SOLVED]How do you get_dir_file_info date into mysql? - El Forum - 05-25-2009 [eluser]zimco[/eluser] DOH! Apparently you just use an unsigned int to represent unix time: Code: `date` int unsigned, |