Turbe$Z Posted March 6 Share Posted March 6 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
Turbe$Z Posted March 6 Author Share Posted March 6 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
WWW Posted March 6 Share Posted March 6 dbExec(connection,"UPDATE interiors SET megujitva = CURRENT_TIMESTAMP(6) WHERE id = ?",idd) 1 Link to comment
FlorinSzasz Posted March 6 Share Posted March 6 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. 1 Link to comment
Turbe$Z Posted March 6 Author Share Posted March 6 28 minutes ago, WWW said: dbExec(connection,"UPDATE interiors SET megujitva = CURRENT_TIMESTAMP(6) WHERE id = ?",idd) ahhh man, thank you so much Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now