Jump to content

[help] why cant update the timestamp in sql?


Recommended Posts

I have this line: 

		dbExec(connection,"UPDATE interiors SET megujitva = ? WHERE id = ?",getTimestamp(),idd)

And the funny thing is, in the same script and same function, this is works good, i get the correct date data. But when i try in another function in the same script, i get 0000-00-00 00:00:00. Why? What the difference, cause i copied exactly the same code part (which is working) to the another function, and i got only zeros!? I dont understand... how to fix this?

Link to comment
9 minutes ago, WWW said:

Can you show the database structure?

You mean this?

ALTER TABLE `interiors` CHANGE `megujitva` `megujitva` TIMESTAMP(6) on update CURRENT_TIMESTAMP(6) NOT NULL DEFAULT 'current_timestamp(6)';

Sorry this is my first time using MySQL

Link to comment
4 minutes ago, Turbe$Z said:

You mean this?

ALTER TABLE `interiors` CHANGE `megujitva` `megujitva` TIMESTAMP(6) on update CURRENT_TIMESTAMP(6) NOT NULL DEFAULT 'current_timestamp(6)';

Sorry this is my first time using MySQL

he means the interiors table structure like what columns and data type do you have and so on.

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...