NYCPHP Meetup

NYPHP.org

[nycphp-talk] mysql: timestamp issue?

bzcoder bzcoder at bzcode.com
Thu Jul 3 02:58:26 EDT 2008


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.
>


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.



More information about the talk mailing list