Welcome Guest, Not a member yet? Register   Sign In
Storing datetime in MySQL and using it
#1

[eluser]Assim[/eluser]
I want to know how my CodeIgniter can store date and time in MySQL and how to use it. I've read this in the User Guide but I need information from people with experience in such matters.

-What should be my column data type be? datetime or something else.
-How can I send the current date and time in a MySQL field.
-How can I compare between two date and time fields, for example how many days, hours, etc was from one row from another.
-Tell me anything else that might be useful and worth knowing.
#2

[eluser]umefarooq[/eluser]
you column data type can be datetime if you are using this then you have to send datetime in mysql format like 2009-02-22 12:24:05 yy-mm-dd hh:mmConfuseds format, for your more problems you can use mysql date and time functions will really helpful for you to find out difference between dates

http://dev.mysql.com/doc/refman/5.1/en/d...tions.html
#3

[eluser]Assim[/eluser]
How about if I wanted to make use of the date helper of CodeIgniter?




Theme © iAndrew 2016 - Forum software by © MyBB