当前位置: 首页>>代码示例>>PHP>>正文


PHP cubrid_real_escape_string函数代码示例

本文整理汇总了PHP中cubrid_real_escape_string函数的典型用法代码示例。如果您正苦于以下问题:PHP cubrid_real_escape_string函数的具体用法?PHP cubrid_real_escape_string怎么用?PHP cubrid_real_escape_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cubrid_real_escape_string函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _escape_str

 /**
  * Platform-dependant string escape
  *
  * @param	string
  * @return	string
  */
 protected function _escape_str($str)
 {
     if (function_exists('cubrid_real_escape_string') && (is_resource($this->conn_id) or get_resource_type($this->conn_id) === 'Unknown' && preg_match('/Resource id #/', strval($this->conn_id)))) {
         return cubrid_real_escape_string($str, $this->conn_id);
     }
     return addslashes($str);
 }
开发者ID:heruprambadi,项目名称:sim_penyuratan,代码行数:13,代码来源:cubrid_driver.php

示例2: escape_str

 /**
  * Escape String
  *
  * @access	public
  * @param	string
  * @param	bool	whether or not the string will be used in a LIKE condition
  * @return	string
  */
 function escape_str($str, $like = FALSE)
 {
     if (is_array($str)) {
         foreach ($str as $key => $val) {
             $str[$key] = $this->escape_str($val, $like);
         }
         return $str;
     }
     if (function_exists('cubrid_real_escape_string') and is_resource($this->conn_id)) {
         $str = cubrid_real_escape_string($str, $this->conn_id);
     } else {
         $str = addslashes($str);
     }
     // escape LIKE condition wildcards
     if ($like === TRUE) {
         $str = str_replace(array('%', '_'), array('\\%', '\\_'), $str);
     }
     return $str;
 }
开发者ID:pravinhirmukhe,项目名称:punelic,代码行数:27,代码来源:cubrid_driver.php

示例3: _escape_str

 /**
  * Platform-dependant string escape
  *
  * @param	string
  * @return	string
  */
 protected function _escape_str($str)
 {
     return cubrid_real_escape_string($str, $this->conn_id);
 }
开发者ID:fuzeworks,项目名称:core,代码行数:10,代码来源:cubrid_driver.php

示例4: realEscapeString

 public function realEscapeString($data = '')
 {
     if (empty($this->connect)) {
         return false;
     }
     return cubrid_real_escape_string($data, $this->connect);
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:7,代码来源:Cubrid.php

示例5: escape_str

 /**
  * Escape String
  *
  * @param	string
  * @param	bool	whether or not the string will be used in a LIKE condition
  * @return	string
  */
 public function escape_str($str, $like = FALSE)
 {
     if (is_array($str)) {
         foreach ($str as $key => $val) {
             $str[$key] = $this->escape_str($val, $like);
         }
         return $str;
     }
     if (function_exists('cubrid_real_escape_string') && (is_resource($this->conn_id) or get_resource_type($this->conn_id) === 'Unknown' && preg_match('/Resource id #/', strval($this->conn_id)))) {
         $str = cubrid_real_escape_string($str, $this->conn_id);
     } else {
         $str = addslashes($str);
     }
     // escape LIKE condition wildcards
     if ($like === TRUE) {
         return str_replace(array('%', '_'), array('\\%', '\\_'), $str);
     }
     return $str;
 }
开发者ID:colonia,项目名称:tomatocart-v2,代码行数:26,代码来源:cubrid_driver.php

示例6: escape

 /**
  * Escape all unescaped string
  *
  * @param string $string
  * @return void
  */
 public function escape($string)
 {
     if (is_null($this->link)) {
         $this->init();
     }
     if (function_exists('cubrid_real_escape_string')) {
         $string = cubrid_real_escape_string($string, $this->link);
     } else {
         $string = addslashes($string);
     }
     return $string;
 }
开发者ID:ainuloverflow,项目名称:raportonline,代码行数:18,代码来源:Cubrid.php

示例7: escape

 function escape($str)
 {
     // If there is no existing database connection then try to connect
     if (!isset($this->dbh) || !$this->dbh) {
         $this->connect($this->dbuser, $this->dbpassword, $this->dbhost);
     }
     return cubrid_real_escape_string(stripslashes($str));
 }
开发者ID:m-osama,项目名称:astm,代码行数:8,代码来源:ez_sql_cubrid.php

示例8: testCubridRealEscapeString2

 /**
  * @group arnia-wrong-parameters-count
  */
 public function testCubridRealEscapeString2()
 {
     if (OUTPUT_FUNCTION_NAME == true) {
         echo "\r\nRunning: " . __FUNCTION__ . " = ";
     }
     try {
         $this->sql = "SELECT \\abc\\, 'ds' FROM db_root";
         $escaped_sql = cubrid_real_escape_string();
         $this->assertTrue(FALSE, "Expected Exception not thrown.");
     } catch (Exception $e) {
         //echo $e->getMessage();
         $this->assertEquals(0, cubrid_error_code());
         $this->assertEquals(0, cubrid_error_code_facility());
         $this->assertEquals('', cubrid_error_msg());
     }
 }
开发者ID:CUBRID,项目名称:cubrid-php,代码行数:19,代码来源:cubrid.php

示例9: sql_escape_string

function sql_escape_string($string, $link = null)
{
    if (isset($link)) {
        $string = cubrid_real_escape_string($string, $link);
    }
    if (!isset($link)) {
        $string = cubrid_real_escape_string($string);
    }
    if ($string === false) {
        output_error("SQL Error: " . sql_error(), E_USER_ERROR);
        return false;
    }
    return $string;
}
开发者ID:BackupTheBerlios,项目名称:idb,代码行数:14,代码来源:cubrid.php


注:本文中的cubrid_real_escape_string函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。