本文整理汇总了PHP中ibase_gen_id函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_gen_id函数的具体用法?PHP ibase_gen_id怎么用?PHP ibase_gen_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ibase_gen_id函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInsertId
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
* @param string generator name
* @return int|FALSE int on success or FALSE on failure
*/
public function getInsertId($sequence)
{
return ibase_gen_id($sequence, 0, $this->connection);
}
示例2: insert_id
/**
* Insert ID
*
* @param string $generator_name
* @param int $inc_by
* @return int
*/
public function insert_id($generator_name, $inc_by = 0)
{
//If a generator hasn't been used before it will return 0
return ibase_gen_id('"' . $generator_name . '"', $inc_by);
}
示例3: getNextSequence
/**
* @brief 1씩 증가되는 sequence값을 return (firebird의 generator 값을 증가)
**/
function getNextSequence()
{
$gen = "GEN_" . $this->prefix . "sequence_ID";
$sequence = ibase_gen_id($gen, 1);
return $sequence;
}
示例4: insertId
public function insertId()
{
if (!empty($this->connect)) {
return ibase_gen_id('id');
} else {
return false;
}
}
示例5: genid
function genid($tablename)
{
if ($this->debug) {
echo "<pre style=\"color : green\">Getting a generator id from {$this->dbpath} <p style=\"color:purple;\"> {$tablename} </p></pre>";
}
switch ($this->dbtype) {
/* Firebird Functionality */
case "firebird":
//write some things here
$id = ibase_gen_id(strtoupper("GEN_" . $tablename . "_ID"), 1, $this->dbh);
break;
/* SQLite Functionality */
/* SQLite Functionality */
case "sqlite":
//See how to get an autonumber from a table
$exist = $this->fetch("select name from sqlite_master where type='table' and upper(name) = upper('{$tablename}')");
if ($exist->NAME == "") {
$this->exec("create table cde_gen (id integer not null, tablename varchar (100) not null, primary key (id, tablename))");
}
$id = $this->fetch("select max(id) as maxid from cde_gen where upper(tablename) = upper('{$tablename}')");
if ($id->MAXID == "") {
$newid = 0;
} else {
$newid = $id->MAXID;
}
$newid++;
$this->exec("insert into cde_gen (id, tablename) values ({$newid}, upper('{$tablename}'))");
$this->commit();
$id = $newid;
break;
/* Oracle Functionality */
/* Oracle Functionality */
case "oracle":
//See how to get an autonumber from a table
break;
}
return $id;
if ($this->debug) {
echo "<pre style=\"color : blue\">Getting a generator {$id} \n </pre>";
}
}
示例6: incrementaGenerator
protected function incrementaGenerator($nomeGenerator) {
return ibase_gen_id($nomeGenerator, 1);
}