本文整理匯總了PHP中DBC::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBC::get方法的具體用法?PHP DBC::get怎麽用?PHP DBC::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBC
的用法示例。
在下文中一共展示了DBC::get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: insertRowInDb
public function insertRowInDb($info, $insertId, $nextRowNum = '', $inPlace = false)
{
$preparedSets = array();
$queryParams = array();
$afterAddArray = array();
$fileColumns = array('name', 'size', 'type');
if (!stristr($this->permissions, 'A')) {
$this->handleHacking();
}
foreach ($info as $col => $val) {
if (isset($this->tableColumns[$col])) {
// Check to make sure the column has add permissions
if (!stristr($this->tableColumns[$col]['perms'], 'A')) {
$this->handleHacking();
}
$val = $this->validateInputValue($col, $val, $info, 'add', $inPlace);
$val = $this->getSqlValue($col, $val);
if ($val === false && !isset($this->tableColumns[$col]['mysql_add_fun'])) {
continue;
}
$preparedSets[] = $this->getAddEditPreparedSet($col, $val, 'add');
if ($val !== null && !isset($this->tableColumns[$col]['mysql_add_fun'])) {
$queryParams[$col] = $val;
}
$afterAddArray[$col] = $val;
}
}
if (!$this->valError) {
if (!empty($this->userInsertFun) && is_callable($this->userInsertFun)) {
return call_user_func($this->userInsertFun, $this->primaryKeyCol, '', $afterAddArray, $this->instanceName, $nextRowNum);
}
if (count($preparedSets) == 0) {
$preparedSets[] = $this->primaryKeyCol . " = ''";
}
$query = "insert into {$this->tableName} set " . implode(', ', $preparedSets);
//$this->information[] = $query;
$result = $this->doQuery($query, $queryParams);
if ($result) {
$insertId = strlen($insertId) > 0 ? $insertId : DBC::get()->lastInsertId();
if (!empty($this->afterAddFun) && is_callable($this->afterAddFun)) {
call_user_func($this->afterAddFun, $this->primaryKeyCol, $insertId, $afterAddArray, $this->instanceName, $nextRowNum);
}
}
}
return $insertId;
}
示例2: setMysqlLocale
protected function setMysqlLocale()
{
$query = "SET lc_time_names = 'cs_CZ'";
$result = DBC::get()->query($query);
}
示例3: __construct
public function __construct($table, $alias = '', $connexion = null)
{
$this->table = $table;
$this->aliasTable = $table . ' ' . $alias;
$this->con = $connexion === null ? DBC::get() : $connexion;
}