Database Timestamp ? |
Hi guys
Quick question regarding database automatic timestamps. From the User Guide ... Quote:$useTimestamps Quote:$dateFormat Which do you use and why? Does the datetime option use the MySql timestamp, or is this not used at all. Thanks
@MeltedRolo,
When it comes to timestamps you can either use it from the web server where PHP is installed or the database server (assuming that they are not installed on the same server). In most of my cases I've used a combination of both. It just depends on the system and sometimes the location of the web server and or database server.
Hi
Thanks for the reply. I would really rather use the time from PHP, and was wondering which of the options above would be ruled out based on that decision, as I have no idea how the database model inserts or doesnt insert the timestamp fields. Thanks
Hi again.
Is my thinking correct on this. The default is datetime, so my database columns will need to be VARCHAR(25). If I choose INT, then my database columns will need to be INT(14). If i,m using Mysql timestamps, then that's handled by the database, so I should not be using $useTimestamps = true. Thanks
No you use either TIMESTAMP or DATETIME for storing the date / time fields.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |