NYCPHP Meetup

NYPHP.org

[nycphp-talk] mysql: timestamp issue?

Anirudh Zala arzala at gmail.com
Thu Jul 3 07:48:34 EDT 2008


On Thursday 03 Jul 2008 12:28:26 bzcoder wrote:
> Marc Antony Vose wrote:
> > I'm checking out my code now to see if there's a difference in the
> > editions update form vs. the titles update form, but both forms run
> > through the same framework.
> >
> > Very odd...perhaps just an idiotic mistake of mine somewhere.

Please also make sure that data is really getting modified. For example if you 
edit record by various ways but actual data residing in fields are not 
changing then MySQL would not update timestamp.

Anirudh Zala

>
> An easy way to test would be to do  a meaningless update from NaviCat,
> phpmyAdmin, the mysql command line, or whatever you prefer to use to run
> SQL commands manually.
>
> For each table, update a single record and make a change to the title or
> some other text field, and then change it back.
>
> Then pull up the 2 records and see if the timestamp updated
> appropriately in both tables.
>
> If it did, than you know there is a problem in your code somewhere.
>
> Note: just because one table works and one doesn't, does not mean the
> update timestamp field is working in one and not the other - it is very
> possible that your code actually updates the timestamp explicitly in one
> case to the current timestamp, while in the other it updates it to
> current value explicitly.
>
> Since you say your using 5.0, if you have control over your mysql server
> I'd recommend enabling the general query log and checking that rather
> than tediously going through your code to find what the update
> statements are.  http://dev.mysql.com/doc/refman/5.0/en/query-log.html
>
> That will tell you precisely what SQL commands are sent to the server.
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php





More information about the talk mailing list