Rate this script:  I Love it  /   I Hate it

Smart MySQL Escape Function


Code


        // check to see if a string needs to be escaped for database input
        function escapeit ( $text ) {
               
                if ( get_magic_quotes_gpc() ) {
                        $text = stripslashes($text);
                }
               
                if ( !is_numeric($text) ) {
                       
                        $text = mysql_real_escape_string($text);
                       
                }
               
                return $text;
               
        }
 

 

 
Smart MySQL Escape Function scripts | Smart MySQL Escape Function snippet | Smart MySQL Escape Function example | Smart MySQL Escape Function tutorial | Smart MySQL Escape Function code