Skip to content
Advertisement

How to use INSERT INTO — SELECT with new timestamp?

I’m working on a small website, that keep tracks of students information, When someone makes an update on one of the students I want to archive a copy of the previous record, I know that doing this makes a copy of the current data.

But I want to include the date when the edit was made, so I tried this, but it produces the following error:


Trying the following query – same error produced

Advertisement

Answer

You should list all the columns and then you can set the value:

Remember to pass the id as a parameter.

EDIT: (based on the edit to your question)

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement