Saving timestamp in mysql table using php Saving timestamp in mysql table using php php php

Saving timestamp in mysql table using php


pass like this

date('Y-m-d H:i:s','1299762201428')


Hey there, use the FROM_UNIXTIME() function for this.

Like this:

INSERT INTO table_name(id,d_id,l_id,connection,s_time,upload_items_count,download_items_count,t_time,status)VALUES(1,5,9,'2',FROM_UNIXTIME(1299762201428),5,10,20,'1'), (2,5,9,'2',FROM_UNIXTIME(1299762201428),5,10,20,'1')


$created_date = date("Y-m-d H:i:s");$sql = "INSERT INTO $tbl_name(created_date)VALUES('$created_date')";$result = mysql_query($sql);