Re: mysql_real_escape_string() question
| From: | tedd | Date: | Thu, 28 Sep 2006 18:18:22 +0000 |
| Subject: | Re: mysql_real_escape_string() question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242372@lists.php.net to get a copy of this message | ||
At 11:06 AM -0500 9/28/06, Richard Lynch wrote:
What's up with that? Any ideas as to what happened? One also has to ask WHY you would use MySQL's escaping for data that's not going into MySQL. That's almost certainly "wrong"Richard: Yes, according to: http://us3.php.net/mysql_real_escape_string The use of the statement looks for a MySQL connection and if there isn't one, it tries to connect and thus producing the error I got when it failed. The answer to "WHY" I did it is that I cut/pasted the code from another script. I was only concerned with cleaning the input and not with using MySQL -- it was just one statement in several to scrub various inputs. However, I would have thought that if the code was going to fail, it would have done so immediately. But it instead, it ran for weeks without failure until just a few days ago. I checked the script almost daily to see if it ran. While it seems very unlikely to me, I must have also tested code that opened a MySQL connection before testing that script. Strange circumstances. Thanks for the clarification. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com