Forum Moderators: coopster

Message Too Old, No Replies

Script to insert date in memo field

         

Shaman13

6:41 pm on Dec 30, 2004 (gmt 0)

10+ Year Member



Good Day Everyone! Has anyone had any experience with creating a simple Php script to insert the current date in a MySQL memo field. The idea is the user clicks on a button which inserts the current date in Y/m/d format into a memo field prior to making their text entry. My users are a little lazy and think that typing the date into the field prior to entering their notes is too time consuming! Who would think! Anyway, if you have comments or thoughts on how to accomplish this they would be greatly appreciated! Have an Awesome Day!

ergophobe

7:24 pm on Dec 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



MySQL has a built-in function "now()" that inserts the time and date.

INSERT INTO my_table (my_comment, my_date_and_time_of_comment) VALUES ("This is my comment", now());

There are many other options. See
[dev.mysql.com...]

Tom

Shaman13

8:07 pm on Dec 30, 2004 (gmt 0)

10+ Year Member



Thanks Tom Happy Holidays!