本文整理汇总了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;
}