本文整理匯總了PHP中CDbConnection::quoteValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP CDbConnection::quoteValue方法的具體用法?PHP CDbConnection::quoteValue怎麽用?PHP CDbConnection::quoteValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CDbConnection
的用法示例。
在下文中一共展示了CDbConnection::quoteValue方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: secureOutput
/**
* Generates a string which is suitable for output into an sql query from
* any data that may be outputable. This method protects strings against
*
* @param CDbConnection $connection
* @param mixed $columnInsertValue
* @return string
*/
public function secureOutput(CDbConnection $connection, $columnInsertValue)
{
if ($columnInsertValue === null) {
return 'NULL';
}
return $connection->quoteValue($columnInsertValue);
}
示例2: _treeLimits
/**
* gets the list of left and right boundaries for any given owner objects.
*
* @param CDbConnection $db
* @param string $tree_table
* @param string $obj_id
*
* @returns array of array(left, right)
*/
protected function _treeLimits($db, $tree_table, $obj_id)
{
$query = 'SELECT ' . $this->leftAttribute . ',' . $this->rightAttribute . ' FROM ' . $tree_table . ' WHERE ' . $this->idAttribute . ' = ' . $db->quoteValue($obj_id);
$res = $db->createCommand($query)->query();
$result = array();
foreach ($res as $r) {
$result[] = array($r[$this->leftAttribute], $r[$this->rightAttribute]);
}
return $result;
}
示例3: escape
public function escape($string)
{
$this->db->quoteValue($string);
}