List:General Discussion« Previous MessageNext Message »
From:Andrew Braithwaite Date:November 18 2002 5:15pm
Subject:RE: Disappearing records?
View as plain text  
Greg Macek said..
---------------------------------------
>>I have a problem that I could use some help with. We're running a
mysql/php intranet site for time sheets (home grown solution). However from
time to time a user will tell me hours from the previous week are just
"gone". I go to look and sure enough, no hours have been entered. I have not
been bitten by this bug (yet), but I have never encountered this problem
with any other databases that exist on this very same box. I have mysql
logging enabled and cannot even find existence of these records being
inserted into the database at all. 

>>Where should I start looking for clues? I am at a loss. Any direction is
appreciated.
----------------------------------------------

Greg,

In my experience, it will be something simple like not escaping ticks...

Are you escaping mysql unfriendly characters from text?  i.e. "'" vs "\'"

I use a simple logfile to to track these kinds of things.  In your case, I
would put a line of code in your script, right before the line that executes
the insert into MySql that writes the query into a plaintext log somewhere.

Sequence in code..
1. Build the sql statement & store in a variable.
2. Using that variable and a unix date, write a line in the logfile.
3. Execute the sql in the variable.

When the user says that records are missing, you can look back in the log
and find out whether the query was ever sent to mysql in the first place and
what that query was.

If I had to guess, I would say the problem would be in the app or mysql
syntax error rather than a mysql itself problem.

Hope this helps,

Andrew
Sql,mysql
Thread
Disappearing records?Greg Macek18 Nov
  • Re: Disappearing records?Dan Nelson18 Nov
    • Re: Disappearing records?Greg Macek18 Nov
      • Re: Disappearing records?Dan Nelson18 Nov
        • Re: Disappearing records?Greg Macek18 Nov
  • Re: Disappearing records?Michael T. Babcock18 Nov
RE: Disappearing records?Andrew Braithwaite18 Nov