你引用了不存在的对象
对象$mydb没有创建或创建失败
对象$mydb没有创建或创建失败
解决方案 »
- 求助正则表达式
- 有关mysql_fetch_array反回中文的问题
- FCKeditor编辑器编辑后中文字成为十进制编码
- in_array和array_keys哪个效率更快
- 关于php的session.怎么让session不过期..session.cookie_lifetime=0不起作用啊
- 如何测试MYSQL是否安装正确??
- 表单上有一文本域(textarea),用于查询时输入要查询的关键字?用户要输入多个关键字中间用回车分开,我怎样分开这些值,存在不同的变量里?
- 中秋快乐~~ 散分!!
- 怎样在WIN98环境下,将php、asp、jsp、cfm集成到APACHE服务器中,会一种也可以……
- Linux 下 , php 調用 java 的 class 出錯,請高手幫忙
- 这个是什么意思?
- 一搜的这个mp3搜索是怎么编码的呀
在网页上引用了,对象应该已经建立了啊!!
<?php
require_once ("includes/db_conn.inc");
session_start();
$username=$_SESSION['username'];if(isset($_GET['action'])) $action=$_GET['action'];
else $action="";<html>
<head>
<title>管理员管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="topbg">
<td height="22" colspan="2" align="center"><strong>管 理 员 管 理</strong></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30"><a href="admin_admin.php">管理员管理首页</a> | <a href="admin_admin.php?action=add">新增管理员</a></td>
</tr>
</table><?php
switch($action){
case "add":
addadmin();
break;
case "modify":
modify();
break;
case "saveadd":
saveadd();
break;
case "savemodify":
savemodify();
break;
case "del":
deladmin();
break;
default:
main();
break;
}
?>
<?php
function main()
{
$sql="select * from manager order by id";
$result = $mydb->simpleQuery($sql);
$iCount = $mydb->numRows($result);
$row = $mydb->fetchRow($result,DB_FETCHMODE_ASSOC);
?>
<br>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
<tr>
<form name="myform" method="Post" action="admin_admin.php" onsubmit="return confirm('确定要删除选中的管理员吗?');">
<td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr align="center" class="title">
<td width="30"><strong>选中</strong></td>
<td width="30" height="22"><strong> 序号</strong></td>
<td height="22"><strong> 用 户 名</strong></td>
<td width="100" height="22"><strong> 权 限</strong></td>
<td width="100" height="22"><strong> 操 作</strong></td>
</tr>
<?php while (is_array($row)){?>
<tr align="center" class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td width="30"><input name="ID" type="checkbox" id="ID" value="<?php echo $row['id'];?>" <?php if($row['username']==$username) echo "disabled";?> onclick="unselectall()"></td>
<td width="30"><?php echo $row['id'];?></td>
<td><?php
if($row['username']==$username)
echo "<font color=red><b>".$username."</b></font>";
else
echo $row['username'];
?></td>
<td width="100">
<?php
if($row['level']==1) echo "超级用户";
else echo "普通用户";
?> </td>
<td width="100">
<?php
echo "<a href='admin_admin.php?action=modify&ID=".$row['id']."'>修改</a> ";
if ($iCount>1 && $row['username']!=$username)
echo "<a href='admin_admin.php?action=del&ID=".$row['id']."' onClick=\"return confirm('确定要删除此管理员吗?');\">删除</a>";
else
echo " ";
?>
</td>
</tr>
<?php
$row = $mydb->fetchRow($result,DB_FETCHMODE_ASSOC);
}
if ($iCount>0) $mydb->freeResult($result);
?>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
选中本页显示的所有管理员</td>
<td><input name="action" type="hidden" id="action" value="del">
<input name="Submit" type="submit" id="Submit" value="删除选中的管理员"></td>
</tr>
</table>
</td>
</form></tr></table>
<?php
}