Re: Sanitizing potential MySQL strings with no database connection

From: Date: Sat, 17 Oct 2009 17:59:52 +0000
Subject: Re: Sanitizing potential MySQL strings with no database connection
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-299020@lists.php.net to get a copy of this message
> I don't think so since the mysql_real_escape_string() requires a connection handler.  Why > not use bind param? > Thanks. I just googled bind param but I am still a bit unclear as to what is going on. To be clear, I have a file of functions that I use in many scripts, lets call it functions.inc. One of the functions calls mysql_real_escape_string() but in order to do that it looks like I have to connect to a database. However, different scripts connect to different databases, and some do not connect to a database at all, so I cannot simple connect to a database from the functions.inc file as that will interfere with the database connections going on in the scripts including that file. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il

« previous php.general (#299020) next »