Changeset 71 for trunk/lib/DB.inc.php


Ignore:
Timestamp:
Mar 18, 2006 3:26:42 AM (18 years ago)
Author:
scdev
Message:

minor misc bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/DB.inc.php

    r70 r71  
    225225    {
    226226        return $this->_connected;
     227    }
     228   
     229    /**
     230     * Returns a properly escaped string using mysql_real_escape_string() with the current connection's charset.
     231     *
     232     * @access  public
     233     * @param   string  $string     Input string to be sent as SQL query.
     234     * @return  string              Escaped string from mysql_real_escape_string()
     235     * @author  Quinn Comendant <quinn@strangecode.com>
     236     * @since   06 Mar 2006 16:41:32
     237     */
     238    function escapeString($string)
     239    {
     240        if (!isset($this) || !is_a($this, 'DB') && !is_subclass_of($this, 'DB')) {
     241            $this =& DB::getInstance();
     242        }
     243        return mysql_real_escape_string($string, $this->dbh);
    227244    }
    228245
Note: See TracChangeset for help on using the changeset viewer.