易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP连接MYSQL数据库

<p>04级新生名单</p>
<table border="1" width="80%" cellpadding="0">
<tr>
<td width="10%" align="center">Id</td>
<td width="20%" align="center">Name</td>
<td width="10%" align="center">Age</td>
<td width="10%" align="center">Sex</td>
<td width="30%" align="center">Address</td>
<td width="20%" align="center">DoWith</td>
</tr>
<?php
//连接数据库
//打开一个连接,连接到本地mysql数据库
$conn=mysql_connect("localhost","root","dalyluo");//ip,user,pwd
//选择操作的资料库
mysql_select_db("test",$conn);// 资料库名称,连接
$sql="select * from student";

//用mysql_query函数从资料库中查询
mysql_query("set names gbk");//处理中文乱码问题,gbk可以是其它值
$result=mysql_query($sql,$conn);// search sql, connection
//循环读取记录
while($row=mysql_fetch_array($result)){
?>
<tr>
<td width="10%" align="center"><?php echo $row["stuid"] ?></td>
<td width="20%" align="center"><?php echo $row["stuname"] ?></td>
<td width="10%" align="center"><?php echo $row["stuage"] ?></td>
<td width="10%" align="center"><?=$row["stusex"]?></td>
<td width="30%" align="center"><?=$row["stuaddress"]?></td>
<td width="20%" align="center"><a href="#" mce_href="#" onClick="<?php doDel($row["stuid"]) ?>">删除</a></td>
</tr>
<?php
}
//关闭连接
mysql_close($conn);
function doDel($sid){
global $conn;
mysql_select_db("test",$conn);
$del_sql="delect from student where stuid="+$sid;
mysql_query($del_sql,$conn);
}
?>
</table>


相关文档:

mysql archive存储引擎

http://www.mysqlperformanceblog.com/2006/11/12/trying-archive-storage-engine/
(1)在相同的条件下,archive的数据大小远小于myisam
(2)在压缩archive数据时,bzip2好于gzip
(3)需要添加archive的方法和压缩的level,以满足不同用户的需求
(4)这个存储引擎适用于日志数据
(5)此引擎不能update,delete,并 ......

windows2003+iis6+php+mysql 服务器配置

在网上看了很多关于windows2003+iis6+php+mysql 服务器配置的文章,大体上都是互相抄袭,不过一些公共的信息还是很正确的,但是针对一些特别的机器或者因为个人不同的配置总不能按照文章的内容操作成功,下面说一种较为简单的操作方法,步骤如下:
1.iis安装(略)
2.下载AppServ并安装
3.在c:\建php5文件夹,然后再php5 ......

mysql+php无法连接sql(已解决)

搞了很久。。终于发现原来是权限问题。。
2行命令搞定
grant all privileges on rogue.* to admin@localhost identified by 'admin' with grant option
grant all privileges on rogue.* to admin@'%' identified by 'admin' with grant option
经典了。。。
魔力私服网页端搞定咯~~ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号