/* No current value, make one */
if (!is_array($res)) {
$currentid = 0;
$q = sprintf("insert into %s values('%s', %s)",
$this->Seq_Table,
$seq_name,
$currentid);
$id = @mysql_query($q, $this->Link_ID);
} else {
$currentid = $res["nextid"];
}
$nextid = $currentid + 1;
$q = sprintf("update %s set nextid = '%s' where seq_name = '%s'",
$this->Seq_Table,
$nextid,
$seq_name);
$id = @mysql_query($q, $this->Link_ID);
$this->unlock();
} else {
$this->halt("cannot lock ".$this->Seq_Table." - has it been created?");
return 0;
}
return $nextid;
}
/* 返回整个表的结果 */
function metadata($table='',$full=false) {
$count = 0;
$id = 0;
$res = array();
/*
* Due to compatibility problems with Table we changed the behavior
* of metadata();
* depending on $full, metadata returns the following values:
*
* - full is false (default):
* $result[]:
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags
*
* - full is true
* $result[]:
* ["num_fields"] number of metadata records
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags
* ["meta"][field name] index of field named "field name"
* The last one is used, if you have a field name, but no index.
* Test: if (isset($result['meta']['myfield'])) { ...
*/专题:http://www.qqread.com/php/c222209101.html
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- 使用PHP 5.2 中新的内存管理器 (0次浏览)
- 实例:PHP判断用户是否正确登录转到欢迎界面 (0次浏览)
- 入门:学习掌握PHP的编程语句 (0次浏览)
- 关于PHP的前途 (0次浏览)
- 分析PHP应用程序以查找、诊断和加速运行缓慢的 (0次浏览)
- 动态语言崛起 Delphi For PHP横空出世 (0次浏览)
- Classes and Objects in PHP5 (0次浏览)
- apache 2.2.2 + PHP5.1.4 不能运行的解决办法 (0次浏览)
- Zeus+php+Zend Optimizer安装指南 (0次浏览)
- Windows下的PHP5.0安装配置详解 (0次浏览)



