php查询数据代码怎么写 php查询数据库内容表格( 三 )


//MySQL_ErrorMsg ("不能从查询结果中取得数据 $query");
if (!$this-result || !$this-rows)
return false;
return true;
}
# 移动到指定记录行,将该行结果储存于数组 data 中
function Fetch ($row) {
if(!@mysql_data_seek($this-result, $row))
//MySQL_ErrorMsg ("不能定位到指定数据行 $row");
return false;
$this-data = https://www.04ip.com/post/@mysql_fetch_array($this-result, MYSQL_ASSOC);
//MySQL_ErrorMsg ("不能提取指定数据行数据 $row");
if (!$this-data)
return false;
return true;
}
/* 以下方法将作用于 arows */
/* 此方法将作用于 iid */
function Insert ($query) {
$this-result = @mysql_query($query, $this-id);
if (!$this-result)
{
if ($this-debug)
MySQL_ErrorMsg ("不能执行查询(query): $query");
else
return false;
}
$this-arows = @mysql_affected_rows($this-id);
$this-iid = @mysql_insert_id($this-id);
return true;
}
function Update ($query) {
$this-result = @mysql_query($query, $this-id);
if (!$this-result)
{
if ($this-debug)
MySQL_ErrorMsg ("不能执行查询(query): $query");
else
return false;
}
$this-arows = @mysql_affected_rows($this-id);
if (!$this-arows || $this-arows == -1)
return false;
return true;
}
function Delete ($query) {
$this-result = @mysql_query($query, $this-id);
if (!$this-result)
{
if ($this-debug)
MySQL_ErrorMsg ("不能执行查询(query): $query");
else
return false;
}
$this-arows = @mysql_affected_rows($this-id);
return true;
}
function Error (){
return mysql_error()."(".mysql_errno().")";
}
function Errno (){
return mysql_errno();
}
}
/*
* MySQL_ErrorMsg
* 输出错误信息
*/
function MySQL_ErrorMsg ($msg) {
# 关闭可能影响字符显示的HTML代码
echo("/ul/dl/ol\n");
echo("/table/script\n");
# 错误信息
$text= "font color=\"#000000\" style=\"font-size: 9pt; line-height: 12pt\"p系统提示:".$msg."br";
$text .= "错误信息:";
$text .= mysql_error()."br";
$text .= "错误代码:".mysql_errno()."brbr";
$text .= "请稍候再试,如果问题仍然存在,请与 a href=https://www.04ip.com/"mailto:wuqiong@igenus.org\"系统管理员/a 联系!";
$text .= "/font\n";
die($text);
}
}
?
一些细节的地方自己修改吧主要是我在别的文件专门定义了全局变量,你看一遍 , 把应改的地方改一下就好了
php查询数据代码怎么写的介绍就聊到这里吧,感谢你花时间阅读本站内容 , 更多关于php查询数据库内容表格、php查询数据代码怎么写的信息别忘了在本站进行查找喔 。

推荐阅读