如何将当前日期插入数据库然后检索它?

$query = mysql_query ('insert into pm timestamp values("'.strtotime("now").'")')
echo "<td>".date('d-M-Y H:i:s', $date3)."</td>

timestamp in database is INT(11)

I am able to get today date but I can't get the current time.

please help thank you !

time();

Gives you current date and time in unix format - timestamp

$query = mysql_query ('insert into pm timestamp values("'.time().'")')

and after that when you retreive field value to var $date3 just echo it like you did

echo "<td>".date('d-M-Y H:i:s', $date3)."</td>";

If you want timestamp, use time()

php > echo time();
1406880195

You have to get the timestamp directly in your database with MySql and not with PHP. Change the type of your "timestamp" to timestamp and use the appropriate function "NOW()"

Your request would be like that : INSERT INTO table (timestamp) VALUES 'NOW()'