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

  • SEARCH
  • Home
  • 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 6000167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:39:18+00:00 2026-05-23T00:39:18+00:00

I am running into a slight problem, I need to generate a report that

  • 0

I am running into a slight problem, I need to generate a report that focuses on the changes on certain fields in a database. What I figured to do, is something like this

“If Updated, Insert today’s date in seperate field”

that way, when I generate the report, I can verify which entries have been modified by checking the date.

Problem is, I am unsure how to do this with php/codeigniter

Thanks for the tips!

  • 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-23T00:39:19+00:00Added an answer on May 23, 2026 at 12:39 am

    You could add a timestamp field to your table structure

    your_field timestamp default current_timestamp on update current_timestamp
    

    Take a look at the manual for the available syntax

    http://dev.mysql.com/doc/refman/5.0/en/timestamp.html

    edit.
    If you need to update the time only if specific fields change, then you need a trigger.

    create table test (
    id int not null auto_increment primary key,
    field1 int,
    field2 int,
    field3 int,
    last_update datetime)
    engine = myisam;
    
    
    delimiter //
    drop trigger if exists update_time //
    create trigger update_time before update on test
    for each row begin
        if new.field2 <> old.field2 or new.field3 <> old.field3 then
            set new.last_update = now();
        end if;
    end //
    delimiter ;
    

    in my example last_update field will be update with current time only if field2 or field3 change.

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

Sidebar

Related Questions

Running into a problem where on certain servers we get an error that the
I've begun running into slight issues with certain functions that I've bound to lua
I'm running into a mental roadblock here and I'm hoping that I'm missing something
I keep running into slight variations of a problem in Java and it's starting
I'm running into a bit of a problem with my WCF service that is
I am running into a slight problem in Oracle SQL. I have a table
I'm building a website in Wordpress and am running into a slight problem. My
I've been running into a problem where using objects from two datacontexts that are
Running into a major brick wall here. I have a database of data that
Running into a problem. I have a table defined to hold the values of

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.