Learn PHP The Easiest Way To Insert Time And Date Into Mysql Database Table

Mobile
feeds
Welcome Login | Register

Learn PHP The Easiest Way To Insert Time And Date Into Mysql Database Table
  Forums Index
      » MYSQL Forums
        » » Learn PHP The Easiest Way To Insert Time And Date Into Mysql Database Table



Learn PHP The Easiest Way To Insert Time And Date Into Mysql Database Table
Post Description:
Post Tags: learn, php, the, easiest, way, to, insert, time, and, date, into, mysql, database, table, mysql database, support, help, answers, questions, help
This Post Has Been Viewed 977 Times Since Sat Apr 07, 2007 1:39 pm Posted By hostman with 0 replies
Learn PHP The Easiest Way To Insert Time And Date Into Mysql Database Table
if you are asking yourself this question also, I may have the answer for you. I found the easiest way to enter or insert the time and date automatically into mysql is with the now() function. In this short simple tutorial guide i will show you steps to take to insert the time and date with the year month day hour and even seconds into a mysql database.

first make sure you have mysql database, if you don't have mysql on your website, you can visit our friends at www.webune.com and signup with one of their plans.

so, to insert the time and date inot my tables i use this sql query:



     Code:
$sql = "INSERT INTO table-name(field_name) values (now())'";


if is do the query above, the system will enter a time stamp of "2007-04-04 21:48:37" which is right now..

you also have to make sure that you create the field correctly. you can use this table as and example:


     Code:
CREATE TABLE `post`
(
`post_date` datetime NOT NULL default '0000-00-00 00:00:00',
)


I find that this is the best and easy way to inster the time and day of the current (present) year month day hour and seconds of today.


Leave Your Comments






Share
URL:
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites



Fourms BBCODE:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums





Comments and replies About Learn PHP The Easiest Way To Insert Time And Date Into Mysql Database Table




(0) Comments