RE: disappearing data - please help!

2005-01-31 Thread Sheryl \(Permutations Software\)
Lee wrote:

 Are you escaping the data you insert? If you have apostrophies eg.
Sheryl's Website, you could have problem if you do not escape special
chars. See if it happens with just aa (without the quotes) in all
the fields in the record...then try unescaped words with apostrophies.

I'm not, and I should be. It not the cause of my data disappearing problem
because my test data was safe, but I shouldn't assume that customer-entered
data will be safe. Thanks for the reminder.

 A nasty is case sensitivity. Some MYSQl vers. (esp. unix vers.) install
with case sensivity turned  on  - so make sure all your table names and
stuff match case.

I'm used to that with Unix - everything is case-matched.

 Par down the PHP or what ever script you're using to the minimum ie.
make the test case as blatently simple SQL as possible.

I can't reproduce it with a simple case. It's an intermittant problem, and
it seems to be related to some complexity buried in my program.

- Sheryl



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: disappearing data - please help!

2005-01-31 Thread Mark
 -Original Message-
 From: Sheryl (Permutations Software) [mailto:[EMAIL PROTECTED] 
 Sent: maandag 31 januari 2005 14:44
 To: 'leegold'; mysql@lists.mysql.com
 Subject: RE: disappearing data - please help!
 
  Par down the PHP or what ever script you're using to the minimum
  ie. make the test case as blatently simple SQL as possible.
 
 I can't reproduce it with a simple case. It's an intermittant 
 problem, and it seems to be related to some complexity
 buried in my program.

Hello Sheryl,

Well, just to rule out the obvious, what client library did you link
your PHP to? You can see that running phpinfo(). I mean, if you ever
upgraded from, say, MySQL 3.23, to, say, 4.0.18, the C headers of your
client libraries will have changed, and everything which is statically
linked to them, like PHP, should be recompiled. If your client library is
at 4.0.18, and MySQL itself at, say, 4.0.23, you would still be okay;
but with an older client library, you may expect weirdness. ;)

I'm sure you already looked into this; but just in case you didn't...

- Mark


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: disappearing data

2005-01-31 Thread Sasha Pachev
Sheryl Canter wrote:
I've got a weird problem that's driving me nuts. I'm updating a set of
scripts for a customer database that supports sending out software
registration codes in real time. I've had this working for some time now,
but I'm having the most frustrating problem. Data I've inserted simply
VANISHES.
Sheryl:
A sure way to fix weird problems like this is to get organized a bit. Here is 
how I would approach this problem:

 * Make sure all of your queries are being sent through the same interface in 
your script. The way I accomplish this in mine is to create a subroutine called 
safe_query() and use only that to issue a query. This way you can control a lot 
of things, such as error checking, logging, timing, etc.

 * Make sure to check for errors diligently.
 * Make your version of safe_query() logs everything query it is sending to the 
client

 * Study the logs thoroughly and with a clear mind ( good sleep strongly 
recommended)

 * If after implementing the above steps the problem does not become obvious, 
run mysqld with --log option and capture every command it receives. You could 
indeed have a goblin script/cron-job that deletes the records or something crazy 
like that, and this will help you detect it.

--
Sasha Pachev
AskSasha Linux Consulting
http://www.asksasha.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


disappearing data

2005-01-30 Thread Sheryl Canter
I've got a weird problem that's driving me nuts. I'm updating a set of
scripts for a customer database that supports sending out software
registration codes in real time. I've had this working for some time now,
but I'm having the most frustrating problem. Data I've inserted simply
VANISHES.

 

I've added extensive debugging code to these scripts to track what's going
on - almost line-by-line - and I see NOTHING wrong. The best I can figure is
that the data exists until the script completes, and then (sometimes but not
always) it simply disappears. I get no error messages of any kind, and I
have confirmed that every step of the way things are happening as they
should. Execution is in the order I expect, the variables hold the values I
expect, etc. For example, the echo statements will say that order #1001 or
whatever was inserted, but when I go to look after the script completes,
it's not there! It's not my looking program, either - I've tried two. In
phpMyAdmin I'll look for ever record inserted in the last two days and there
is simply nothing there. I also have a custom program that displays sales
information that similarly shows the order as vanished. And of course, the
total number of records doesn't change - the record that MySQL says it
inserted is definitely not there.

 

What makes this all the more mysterious is that it happens intermittently.
Sometimes when the script completes and reports success, the record really
is there, and sometimes it's not. I am going crazy with this.

 

Does this sound familiar to anyone? Do anyone have any idea what can be
going on?

 

One other bit of weirdness that may be related. The scripts are in a dozen
ore more different files. (This is all CGI-PHP on an Apache server.) One of
the things I was doing during this update was to go through all the scripts
and be more consistent about error handling. There was one file where in the
mysql_query I was specifying the query but not the link (letting it default
- I'm only using one database). I tried adding the connection because it's
in all the other files, but I couldn't. Whenever I tried, I got a warning
and then an error about it being a bad link. But this is not a bad link.
It's the same link I'm using in every file in this database application.

 

Is my computer haunted? Can anyone help?!

 

  - Sheryl

 



disappearing data - please help!

2005-01-30 Thread Sheryl \(Permutations Software\)
I've got a weird problem that's driving me nuts. I'm updating a set of
scripts for a customer database that supports sending out software
registration codes in real time. I've had this working for some time now,
but I'm having the most frustrating problem. Data I've inserted simply
VANISHES.

I've added extensive debugging code to these scripts to track what's going
on - almost line-by-line - and I see NOTHING wrong. The best I can figure is
that the data exists until the script completes, and then (sometimes but not
always) it simply disappears. I get no error messages of any kind, and I
have confirmed that every step of the way things are happening as they
should. Execution is in the order I expect, the variables hold the values I
expect, etc. For example, the echo statements will say that order #1001 or
whatever was inserted, but when I go to look after the script completes,
it's not there! It's not my looking program, either - I've tried two. In
phpMyAdmin I'll look for ever record inserted in the last two days and there
is simply nothing there. I also have a custom program that displays sales
information that similarly shows the order as vanished. And of course, the
total number of records doesn't change - the record that MySQL says it
inserted is definitely not there.

What makes this all the more mysterious is that it happens intermittently.
Sometimes when the script completes and reports success, the record really
is there, and sometimes it's not. I am going crazy with this.

Does this sound familiar to anyone? Do anyone have any idea what can be
going on?

One other bit of weirdness that may be related. The scripts are in a dozen
ore more different files. (This is all CGI-PHP on an Apache server.) One of
the things I was doing during this update was to go through all the scripts
and be more consistent about error handling. There was one file where in the
mysql_query I was specifying the query but not the link (letting it default
- I'm only using one database). I tried adding the connection because it's
in all the other files, but I couldn't. Whenever I tried, I got a warning
and then an error about it being a bad link. But this is not a bad link.
It's the same link I'm using in every file in this database application.

Is my computer haunted? Can anyone help?!

   - Sheryl

 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: disappearing data - please help!

2005-01-30 Thread Jason Martin
On Sun, Jan 30, 2005 at 03:28:56PM -0500, Sheryl (Permutations Software) wrote:
 but I'm having the most frustrating problem. Data I've inserted simply
 VANISHES.
What is the setting for AutoCommit? If it is 0, are you sure
that commit is being called before the session ends?

-Jason Martin
-- 
Felinious Assault: Striking someone with a cat.
This message is PGP/MIME signed.


pgp7rOTL5oXlH.pgp
Description: PGP signature


RE: disappearing data - please help!

2005-01-30 Thread Sheryl \(Permutations Software\)
I thought about this possibility, but I'm not using a database type with
transactions. It's just the default. I don't know where I'd check AutoCommit
settings (or it they even apply to the default database type). It doesn't
refer to this in phpinfo.php.

- Sheryl


-Original Message-
From: Jason Martin [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 30, 2005 3:38 PM
To: mysql@lists.mysql.com
Subject: Re: disappearing data - please help!

On Sun, Jan 30, 2005 at 03:28:56PM -0500, Sheryl (Permutations Software)
wrote:
 but I'm having the most frustrating problem. Data I've inserted simply
 VANISHES.
What is the setting for AutoCommit? If it is 0, are you sure
that commit is being called before the session ends?

-Jason Martin
-- 
Felinious Assault: Striking someone with a cat.
This message is PGP/MIME signed.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: disappearing data - please help!

2005-01-30 Thread Jason Martin
On Sun, Jan 30, 2005 at 04:03:37PM -0500, Sheryl (Permutations Software) wrote:
 transactions. It's just the default. I don't know where I'd check AutoCommit
 settings (or it they even apply to the default database type). It doesn't
 refer to this in phpinfo.php.
Try doing this immediately after inserting the data:
mysql_query(COMMIT, $this-dbh);

and see if that changes anything.

-Jason Martin
-- 
My karma ran over my dogma
This message is PGP/MIME signed.


pgpplCPHXl079.pgp
Description: PGP signature


RE: disappearing data - please help!

2005-01-30 Thread Mark
 -Original Message-
 From: Sheryl (Permutations Software) [mailto:[EMAIL PROTECTED] 
 Sent: zondag 30 januari 2005 21:31
 To: mysql@lists.mysql.com
 Subject: disappearing data - please help!
 
 What makes this all the more mysterious is that it happens 
 intermittently. Sometimes when the script completes and reports
 success, the record really is there, and sometimes it's not.
 I am going crazy with this.

Sounds like a concurrency problem to me. Is your code ACID
(Atomicity, Concurrency, Isolation, Durability) safe?

I do not think it is a commit problem. For one, because PHP/Perl
client interfaces almost always default to auto-commit (so you would
have to have disabled it explicitely); and, for two, because, as long as
your MySQL server still runs, the data is transparently present
(whether physically saved to disk or not).

 I tried adding the connection because it's
 in all the other files, but I couldn't. Whenever I tried, I 
 got a warning and then an error about it being a bad link.
 But this is not a bad link. It's the same link I'm using in every
 file in this database application.

I take it by link you mean something which describes your
database:user:password, etc? Please, show the error. And you are
not sharing the same database handle for multiple connection,
btw, right?

- Mark 
 
System Administrator Asarian-host.org
 
---
If you were supposed to understand it,
we wouldn't call it code. - FedEx


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: disappearing data - please help!

2005-01-30 Thread leegold


  From: Sheryl (Permutations Software) [mailto:[EMAIL PROTECTED] 
  Sent: zondag 30 januari 2005 21:31
  To: mysql@lists.mysql.com
  Subject: disappearing data - please help!
  
  What makes this all the more mysterious is that it happens 
  intermittently. Sometimes when the script completes and reports
  success, the record really is there, and sometimes it's not.
  I am going crazy with this.
...snip...

Are you escaping the data you insert? If you have apostrophies eg.
Sheryl's Website, you could have problem if you do not escape special
chars. See if it happens with just aa (without the quotes) in all
the fields in the record...then try unescaped words with apostrophies.

A nasty is case sensitivity. Some MYSQl vers. (esp. unix vers.) install
with case sensivity turned  on  - so make sure all your table names and
stuff match case.

Par down the PHP or what ever script you're using to the minimum ie.
make the test case as blatently simple SQL as possible.

Lee

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]