Re: [PHP] mysql_real_escape_string() question



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
.



Relevant Pages

  • Re: Does apache stop a script mid execution ?
    ... If the user calls a time consuming script and then stops or refreshes ... How does it relate to e.g. a script performing a large mysql query? ... 2.b) how the connection is set up. ... the server stops the script execution. ...
    (comp.lang.php)
  • Re: Does apache stop a script mid execution ?
    ... If the user calls a time consuming script and then stops or refreshes ... the way the client is implemented in the php mysql extension and 2.b) how the connection is set up. ... the server stops the script execution. ...
    (comp.lang.php)
  • Re: Cyrus IMAP with pam_mysql?
    ... FreeBSD, but if you check the startup script, all the parameters are ... Default log directories are in the default data directory, ... Makefile for mysql) They are changed in the above script prior to ... imaps auth sufficient pam_unix.so ...
    (freebsd-questions)
  • Re: MySQL to SQL
    ... basically I want to take a MySql script and load it into a SQL database. ... BIOS_RELEASE_DATE datetime default NULL, ... CUSTOM_TEXT_FIELD1 mediumtext, ...
    (microsoft.public.scripting.wsh)
  • Re: mysql - kern.maxfiles limit exceeded by uid 500 please see tuning(7)
    ... Since mysql crashes after 5 days of running your script, ... better check its operation and see if it is causing your system to exceed ...
    (comp.unix.bsd.freebsd.misc)