$query="lock tables ";
if (is_array($table)) {
while (list($key,$value)=each($table)) {
if ($key=="read" && $key!=0) {
$query.="$value read, ";
} else {
$query.="$value $mode, ";
}
}
$query=substr($query,0,-2);
} else {
$query.="$table $mode";
}
$res = @mysql_query($query, $this->Link_ID);
if (!$res) {
$this->halt("lock($table, $mode) failed.");
return 0;
}
return $res;
}
function unlock() {
$this->connect();
$res = @mysql_query("unlock tables");
if (!$res) {
$this->halt("unlock() failed.");
return 0;
}
return $res;
}
/* 计算查询的数量 */
function affected_rows() {
return @mysql_affected_rows($this->Link_ID);
}
function num_rows() {
return @mysql_num_rows($this->Query_ID);
}
function num_fields() {
return @mysql_num_fields($this->Query_ID);
}
/* 简化表示的查询结果方法 */
function nf() {
return $this->num_rows();
}
function np() {
print $this->num_rows();
}
function f($Name) {
return $this->Record[$Name];
}
function p($Name) {
print $this->Record[$Name];
}
/* public: sequence numbers */
function nextid($seq_name) {
$this->connect();
if ($this->lock($this->Seq_Table)) {
/* get sequence number (locked) and increment */
$q = sprintf("select nextid from %s where seq_name = '%s'",
$this->Seq_Table,
$seq_name);
$id = @mysql_query($q, $this->Link_ID);
$res = @mysql_fetch_array($id);正文: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次浏览)



