public function replaceTableNeedle($sql, $replace = null)
    {
        $needle  = $this->getTableNeedle();
        $replace = isset($replace) ? $replace : $this->getTablePrefix();
        $sql     = trim($sql);

        $pattern = "($needle(?=[a-z0-9]))";
        $sql = preg_replace($pattern, $replace, $sql);

        return $sql;
    }
public function replaceTableNeedle($sql, $replace = null)
    {
        $needle  = $this->getTableNeedle();
        $replace = isset($replace) ? $replace : $this->getTablePrefix();
        $sql     = trim($sql);

        $pattern = "($needle(?=[a-z0-9]))";
        $sql = preg_replace($pattern, $replace, $sql);

        return $sql;
    }
public function replaceTableNeedle ( $ sql , $ replace = null ) { $ needle = $ this -> getTableNeedle ( ) ; $ replace = isset ( $ replace ) ? $ replace : $ this -> getTablePrefix ( ) ; $ sql = trim ( $ sql ) ; $ pattern = "($needle(?=[a-z0-9]))" ; $ sql = preg_replace ( $ pattern , $ replace , $ sql ) ; return $ sql ; }
This function replaces the table needles in a query string with the actual table prefix.

@param  string 	The SQL query string
@return string	The SQL query string
This function replaces the table needles in a query string with the actual table prefix .