Hello everybody.
There is a row in my db table I have set it's type as "TIMESTAMP". How should I fill in?
Should get the current timestamp in php and send it to that row, correct?
So how can I do that?

Re: how to get current TIMESTAMP in php to fill in db row with TIMESTAMP type 80 80

Why you need to get the timestamp from php and update timestamp field in table? We can always use the CURRENT_TIMESTAMP() directly from mysql. Refer https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html for more options.

Re: how to get current TIMESTAMP in php to fill in db row with TIMESTAMP type 80 80

Well, I still haven't got what to do exactly. Where should I put CURRENT_TIMESTAMP() in the script? I'm using PDO.
Would you please help me more?

Re: how to get current TIMESTAMP in php to fill in db row with TIMESTAMP type 80 80

in your database (phpadmin for example) use default current_timestamp and in attribute on update current_timestamp

Re: how to get current TIMESTAMP in php to fill in db row with TIMESTAMP type 80 80

UPDATE mytable SET timestamp_field = CURRENT_TIMESTAMP()

Re: how to get current TIMESTAMP in php to fill in db row with TIMESTAMP type 80 80

I understood. Thanks friends.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.