• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fbsql_insert_id函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _insertid

 function _insertid()
 {
     return fbsql_insert_id($this->_connectionID);
 }
开发者ID:BackupTheBerlios,项目名称:facturaphp-svn,代码行数:4,代码来源:adodb-fbsql.inc.php


示例2: getInsertID

 /**
  * get last insert ID
  *
  * @return mixed MDB2 Error Object or id
  * @access public
  */
 function getInsertID()
 {
     $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
     return fbsql_insert_id($db->connection);
 }
开发者ID:BackupTheBerlios,项目名称:smart-svn,代码行数:11,代码来源:fbsql.php


示例3: nextId

 /**
  * Returns the next free id in a sequence
  *
  * @param string  $seq_name  name of the sequence
  * @param boolean $ondemand  when true, the seqence is automatically
  *                           created if it does not exist
  *
  * @return int  the next id number in the sequence.  DB_Error if problem.
  *
  * @internal
  * @see DB_common::nextID()
  * @access public
  */
 function nextId($seq_name, $ondemand = true)
 {
     $seqname = $this->getSequenceName($seq_name);
     $repeat = 0;
     do {
         $result = $this->query("INSERT INTO {$seqname} VALUES(NULL)");
         if ($ondemand && DB::isError($result) && $result->getCode() == DB_ERROR_NOSUCHTABLE) {
             $repeat = 1;
             $result = $this->createSequence($seq_name);
             if (DB::isError($result)) {
                 return $result;
             }
         } else {
             $repeat = 0;
         }
     } while ($repeat);
     if (DB::isError($result)) {
         return $result;
     }
     return @fbsql_insert_id($this->connection);
 }
开发者ID:ronaldoof,项目名称:geocloud2,代码行数:34,代码来源:fbsql.php


示例4: nextId

 /**
  * Get the next value in a sequence.  We emulate sequences
  * for fbsql.  Will create the sequence if it does not exist.
  *
  * @access public
  *
  * @param $seq_name the name of the sequence
  *
  * @param $ondemand whether to create the sequence table on demand
  * (default is true)
  *
  * @return a sequence integer, or a DB error
  */
 function nextId($seq_name, $ondemand = true)
 {
     $sqn = preg_replace('/[^a-z0-9_]/i', '_', $seq_name);
     $repeat = 0;
     do {
         $seqname = sprintf($this->getOption("seqname_format"), $sqn);
         $result = $this->query("INSERT INTO {$seqname} VALUES(NULL)");
         if ($ondemand && DB::isError($result) && $result->getCode() == DB_ERROR_NOSUCHTABLE) {
             $repeat = 1;
             $result = $this->createSequence($seq_name);
             if (DB::isError($result)) {
                 return $result;
             }
         } else {
             $repeat = 0;
         }
     } while ($repeat);
     if (DB::isError($result)) {
         return $result;
     }
     return fbsql_insert_id($this->connection);
 }
开发者ID:BackupTheBerlios,项目名称:e-maku-svn,代码行数:35,代码来源:fbsql.php


示例5: nextId

 /**
  * returns the next free id of a sequence
  *
  * @param string  $seq_name name of the sequence
  * @param boolean $ondemand when true the seqence is
  *                          automatic created, if it
  *                          not exists
  *
  * @return mixed MDB_Error or id
  * @access public
  */
 function nextId($seq_name, $ondemand = TRUE)
 {
     $sequence_name = $this->getSequenceName($seq_name);
     $this->expectError(MDB_ERROR_NOSUCHTABLE);
     $result = $this->query("INSERT INTO {$sequence_name} VALUES (NULL)");
     $this->popExpect();
     if ($ondemand && MDB::isError($result) && $result->getCode() == MDB_ERROR_NOSUCHTABLE) {
         // Since we are create the sequence on demand
         // we know the first id = 1 so initialize the
         // sequence at 2
         $result = $this->createSequence($seq_name, 2);
         if (MDB::isError($result)) {
             return $this->raiseError(MDB_ERROR, NULL, NULL, 'Next ID: on demand sequence could not be created');
         } else {
             // First ID of a newly created sequence is 1
             return 1;
         }
     }
     $value = intval(@fbsql_insert_id());
     $res = $this->query("DELETE FROM {$sequence_name} WHERE " . $this->options['sequence_col_name'] . " < {$value}");
     if (MDB::isError($res)) {
         $this->warnings[] = 'Next ID: could not delete previous sequence table values';
     }
     return $value;
 }
开发者ID:Esleelkartea,项目名称:kz-adeada-talleres-electricos-,代码行数:36,代码来源:fbsql.php


示例6: insertId

 public function insertId()
 {
     if (!empty($this->connect)) {
         return fbsql_insert_id($this->connect);
     } else {
         return false;
     }
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:8,代码来源:FbsqlDriver.php


示例7: lastInsertID

 /**
  * Returns the autoincrement ID if supported or $id or fetches the current
  * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
  *
  * @param string $table name of the table into which a new row was inserted
  * @param string $field name of the field into which a new row was inserted
  * @return mixed MDB2 Error Object or id
  * @access public
  */
 function lastInsertID($table = null, $field = null)
 {
     $connection = $this->getConnection();
     if (MDB2::isError($connection)) {
         return $connection;
     }
     $value = @fbsql_insert_id($connection);
     if (!$value) {
         return $this->raiseError(null, null, null, 'Could not get last insert ID', __FUNCTION__);
     }
     return $value;
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:21,代码来源:fbsql.php


示例8: lastInsertID

 /**
  * returns the autoincrement ID if supported or $id
  *
  * @param mixed $id value as returned by getBeforeId()
  * @param string $table name of the table into which a new row was inserted
  * @return mixed MDB2 Error Object or id
  * @access public
  */
 function lastInsertID($table = null, $field = null)
 {
     $connection = $this->getConnection();
     if (PEAR::isError($connection)) {
         return $connection;
     }
     $value = @fbsql_insert_id($connection);
     if (!$value) {
         return $this->raiseError();
     }
     return $value;
 }
开发者ID:ajisantoso,项目名称:kateglo,代码行数:20,代码来源:fbsql.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fbsql_list_dbs函数代码示例发布时间:2022-05-15
下一篇:
PHP fbsql_free_result函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap