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


PHP DB\dbQueryError函数代码示例

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


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

示例1: getContentItems

 public function getContentItems()
 {
     $p =& $this->requestParams;
     $folderTemplates = \CB\Config::get('folder_templates');
     $p['fl'] = 'id,system,path,name,case,date,date_end,size,cid,oid,cdate,uid,udate,template_id,acl_count,cls,status,task_status,dstatus';
     if (@$p['from'] == 'tree') {
         $p['templates'] = $folderTemplates;
     }
     if (is_numeric($this->lastNode->id)) {
         $p['pid'] = $pid;
     }
     $p['dstatus'] = 1;
     $p['fq'] = $this->fq;
     $s = new \CB\Search();
     $rez = $s->query($p);
     if (!empty($rez['data'])) {
         for ($i = 0; $i < sizeof($rez['data']); $i++) {
             $d =& $rez['data'][$i];
             $res = DB\dbQuery('SELECT cfg
                   , (SELECT 1
                      FROM tree
                      WHERE pid = $1' . (@$p['from'] == 'tree' ? ' AND `template_id` IN (0' . implode(',', $folderTemplates) . ')' : '') . ' LIMIT 1) has_childs
                 FROM tree
                 WHERE id = $1', $d['id']) or die(DB\dbQueryError());
             if ($r = $res->fetch_assoc()) {
                 $d['cfg'] = Util\toJSONArray($r['cfg']);
                 $d['has_childs'] = !empty($r['has_childs']);
             }
             $res->close();
         }
     }
     return $rez;
 }
开发者ID:austinvernsonger,项目名称:casebox,代码行数:33,代码来源:RecycleBin.php

示例2: create

 /**
  * create an object with specified params
  * @param  array $p object properties
  * @return int   created id
  */
 public function create($p = false)
 {
     if ($p === false) {
         $p = $this->data;
     }
     // check input params
     if (!isset($p['target_id'])) {
         throw new \Exception("No target id specified for shortcut creation", 1);
     }
     //check if target is also shortuc and replace with its target
     if (Objects::getType($p['target_id']) == 'shortcut') {
         $res = DB\dbQuery('SELECT target_id
             FROM tree
             WHERE id = $1', $p['target_id']) or die(DB\dbQueryError());
         if ($r = $res->fetch_assoc()) {
             $p['target_id'] = $r['target_id'];
         }
         $res->close();
     }
     $p['name'] = 'link to #' . $p['target_id'];
     if (empty($p['template_id'])) {
         $p['template_id'] = \CB\Config::get('default_shortcut_template');
     }
     $this->data = $p;
     return parent::create($p);
 }
开发者ID:austinvernsonger,项目名称:casebox,代码行数:31,代码来源:Shortcut.php

示例3: delete

 /**
  * delete a record by its id
  * @param  int     $id
  * @return boolean
  */
 public static function delete($id)
 {
     static::validateParamTypes(array('id' => $id));
     DB\dbQuery('DELETE from `' . static::$tableName . '` ' . 'WHERE id = $1', $id) or die(DB\dbQueryError());
     $rez = DB\dbAffectedRows() > 0;
     return $rez;
 }
开发者ID:austinvernsonger,项目名称:casebox,代码行数:12,代码来源:Base.php

示例4: read

 /**
  * read objects data in bulk manner
  * @param  array $ids
  * @return array
  */
 public static function read($ids)
 {
     $rez = array();
     $ids = Util\toNumericArray($ids);
     if (!empty($ids)) {
         $sql = 'SELECT t.*
                 ,ti.pids
                 ,ti.path
                 ,ti.case_id
                 ,ti.acl_count
                 ,ti.security_set_id
                 ,o.data
                 ,o.sys_data
             FROM tree t
             JOIN tree_info ti
                 ON t.id = ti.id
             LEFT JOIN objects o
                 ON t.id = o.id
             WHERE t.id in (' . implode(',', $ids) . ')';
         $res = DB\dbQuery($sql) or die(DB\dbQueryError());
         while ($r = $res->fetch_assoc()) {
             $r['data'] = Util\jsonDecode($r['data']);
             $r['sys_data'] = Util\jsonDecode($r['sys_data']);
             $rez[] = $r;
         }
         $res->close();
     }
     return $rez;
 }
开发者ID:ameliefranco,项目名称:casebox,代码行数:34,代码来源:Objects.php

示例5: onNodeDbCreate

 /**
  * create system folders specified in created objects template config as system_folders property
  * @param  object $o
  * @return void
  */
 public function onNodeDbCreate($o)
 {
     if (!is_object($o)) {
         return;
     }
     $template = $o->getTemplate();
     if (empty($template)) {
         return;
     }
     $templateData = $template->getData();
     if (empty($templateData['cfg']['system_folders'])) {
         return;
     }
     $folderIds = Util\toNumericArray($templateData['cfg']['system_folders']);
     if (empty($folderIds)) {
         return;
     }
     $p = array('sourceIds' => array(), 'targetId' => $o->getData()['id']);
     $browserActionsClass = new Browser\Actions();
     $res = DB\dbQuery('SELECT id
         FROM tree
         WHERE pid in (' . implode(',', $folderIds) . ')
             AND dstatus = 0') or die(DB\dbQueryError());
     while ($r = $res->fetch_assoc()) {
         $p['sourceIds'][] = $r['id'];
     }
     $res->close();
     // $browserActionsClass->copy($p);
     $browserActionsClass->objectsClass = new \CB\Objects();
     $browserActionsClass->doRecursiveAction('copy', $p['sourceIds'], $p['targetId']);
 }
开发者ID:youprofit,项目名称:casebox,代码行数:36,代码来源:Listeners.php

示例6: checkTableExistance

 public static function checkTableExistance()
 {
     return DB\dbQuery('CREATE TABLE IF NOT EXISTS `guids`(
             `id` bigint(20) unsigned NOT NULL  auto_increment ,
             `name` varchar(200) COLLATE utf8_general_ci NOT NULL  ,
             PRIMARY KEY (`id`) ,
             UNIQUE KEY `guids_name`(`name`)
         ) ENGINE=InnoDB DEFAULT CHARSET=\'utf8\' COLLATE=\'utf8_general_ci\'', array()) or die(DB\dbQueryError());
 }
开发者ID:youprofit,项目名称:casebox,代码行数:9,代码来源:GUID.php

示例7: deleteByNodeId

 public static function deleteByNodeId($nodeId, $userId = false)
 {
     if ($userId == false) {
         $userId = \CB\User::getId();
     }
     DB\dbQuery('DELETE FROM ' . static::getTableName() . ' WHERE user_id = $1 AND node_id = $2', array($userId, $nodeId)) or die(DB\dbQueryError());
     $rez = DB\dbAffectedRows() > 0;
     return $rez;
 }
开发者ID:youprofit,项目名称:casebox,代码行数:9,代码来源:Favorites.php

示例8: delete

 /**
  * delete core record form __casebox.cores table
  * and drop database
  * @param  varchar $idOrName
  * @return boolean
  */
 public static function delete($idOrName)
 {
     $id = static::toId($idOrName);
     $data = static::read($id);
     $rez = parent::delete($id);
     if ($rez) {
         $dbName = Config::get('prefix') . '_' . $data['name'];
         DB\dbQuery("DROP DATABASE `{$dbName}`") or die(DB\dbQueryError());
     }
     return $rez;
 }
开发者ID:youprofit,项目名称:casebox,代码行数:17,代码来源:Core.php

示例9: getName

 public function getName($id = false)
 {
     if ($id == false) {
         $id = $this->id;
     }
     $rez = 'no name';
     $res = DB\dbQuery('SELECT name FROM tree WHERE id = $1', $id) or die(DB\dbQueryError());
     if ($r = $res->fetch_assoc()) {
         $rez = $r['name'];
     }
     $res->close();
     return $rez;
 }
开发者ID:youprofit,项目名称:casebox,代码行数:13,代码来源:Offices.php

示例10: getVersionByMD5

 /**
  * get oldest version ids after a given skipCount
  * @param  int     $fileId
  * @param  varchar $md5
  * @return array   | false
  */
 public static function getVersionByMD5($fileId, $md5)
 {
     $rez = array();
     $res = DB\dbQuery('SELECT f.*
         FROM files_versions f
         JOIN files_content c ON f.content_id = c.id
             AND c.md5 = $2
         WHERE f.file_id = $1', array($fileId, $md5)) or die(DB\dbQueryError());
     if ($r = $res->fetch_assoc()) {
         $rez = $r;
     }
     return $rez;
 }
开发者ID:youprofit,项目名称:casebox,代码行数:19,代码来源:FilesVersions.php

示例11: getRecords

 /**
  * update a record
  * @param  array $p array with properties
  * @return array
  */
 public static function getRecords($ids)
 {
     $rez = array();
     $ids = Util\toNumericArray($ids);
     $res = DB\dbQuery('SELECT *
         FROM `' . static::getTableName() . '`
         WHERE id in (' . implode(',', $ids) . ')') or die(DB\dbQueryError());
     while ($r = $res->fetch_assoc()) {
         $rez[] = $r;
     }
     $res->close();
     return $rez;
 }
开发者ID:youprofit,项目名称:casebox,代码行数:18,代码来源:Log.php

示例12: copy

 /**
  * copy a record
  * @param  int     $id
  * @return boolean
  */
 public static function copy($sourceId, $targetId)
 {
     DB\dbQuery('INSERT INTO `objects`
             (`id`
             ,`data`
             ,`sys_data`)
         SELECT
             $2
             ,`data`
             ,`sys_data`
         FROM `objects`
         WHERE id = $1', array($sourceId, $targetId)) or die(DB\dbQueryError());
     return DB\dbAffectedRows() > 0;
 }
开发者ID:youprofit,项目名称:casebox,代码行数:19,代码来源:Objects.php

示例13: readNames

 /**
  * read recods in bulk for given names
  * @param  array       $names
  * @return associative array ('name' => id)
  */
 public static function readNames($names)
 {
     $rez = array();
     $params = array();
     for ($i = 1; $i <= sizeof($names); $i++) {
         $params[] = '$' . $i;
     }
     $sql = 'SELECT id, name
         FROM ' . static::getTableName() . '
         WHERE name in (' . implode(',', $params) . ')';
     $res = DB\dbQuery($sql, $names) or die(DB\dbQueryError());
     while ($r = $res->fetch_assoc()) {
         $rez[$r['name']] = $r['id'];
     }
     $res->close();
     return $rez;
 }
开发者ID:ameliefranco,项目名称:casebox,代码行数:22,代码来源:GUID.php

示例14: readAll

 public static function readAll()
 {
     $rez = array();
     $sql = 'SELECT *
         FROM ' . static::getTableName() . '
         ORDER BY pid';
     $res = DB\dbQuery($sql . ', `order`');
     //order by 'order' field also
     //backward compatibility
     if (empty($res)) {
         $res = DB\dbQuery($sql) or die(DB\dbQueryError());
     }
     while ($r = $res->fetch_assoc()) {
         $rez[] = $r;
     }
     $res->close();
     return $rez;
 }
开发者ID:youprofit,项目名称:casebox,代码行数:18,代码来源:Config.php

示例15: getContentPaths

 /**
  * get relative content paths for given file ids
  * path is relative to casebox files directory
  * @param  array $ids
  * @return array associative array (id => relative_content_path)
  */
 public static function getContentPaths($ids)
 {
     $rez = array();
     $ids = Util\toNumericArray($ids);
     if (!empty($ids)) {
         $sql = 'SELECT f.id, c.`path`, f.content_id
             FROM files f
             JOIN files_content c
                 ON f.content_id = c.id
             WHERE f.id in (' . implode(',', $ids) . ')';
         $res = DB\dbQuery($sql) or die(DB\dbQueryError());
         while ($r = $res->fetch_assoc()) {
             $rez[$r['id']] = $r['path'] . DIRECTORY_SEPARATOR . $r['content_id'];
         }
         $res->close();
     }
     return $rez;
 }
开发者ID:ameliefranco,项目名称:casebox,代码行数:24,代码来源:Files.php


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