Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7535537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:19:40+00:00 2026-05-30T06:19:40+00:00

I am trying to set up an sql table which records when an account

  • 0

I am trying to set up an sql table which records when an account was created and when it was last modified. I would like sql to handle this so I don’t have to do it in my php files.

I have two columns in my users table (both are of type timestamp):

created

modified

I want the "created" time to never change and always contain the date it was created, and the "modified" to be changed each time the users row is modified. I have the table set up so "created" works as I expect, but when I try to update modified:

ALTER TABLE `users` 
   CHANGE `modified` `modified` TIMESTAMP NOT NULL 
   DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP

I get the following error:

1293 – Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

Can someone assist me on what I need to do to accomplish this correctly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:19:41+00:00Added an answer on May 30, 2026 at 6:19 am

    It’s stil not possible in mysql. You can have them set to the actual time only on INSERTs, only on UPDATEs or on both. However you couldn’t have more than one of these auto-TIMESTAMP columns in one table. that’s now possible using TRIGGERs if using Mysql 5.x

    Refer this article It will help you lot :

    Two auto-TIMESTAMP columns in one table with MySQL 5.0

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've been trying to insert sql into this one specific table for the
i'm trying to set up some tables in my SQL Express server, and i
I'm trying to get the following SQL statement to work: UPDATE myschema.tableA update_tableA SET
I am trying to set up a simple transaction for my Linq-to-Sql actions against
I have two named instances of SQL Server 2008 and am trying to set
I'm trying to reorder/group a set of results using SQL. I have a few
Im trying set the single table inheritance model type in a form. So i
I have a table in SQL server which has a DATETIME field called Date_Printed.
I am trying to suma column in a table, while excluding certain records that
Using SQL Membership Provider for ASP.NET membership. I'm using first.last as the username, which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.