$id 值能成功获取,可是为什么还不能显示出数据呢?<?php
$id=$_GET["id"]; $conn=mysqli_connect("localhost","root","","test");
$sql="select * from login where id=".$id;
$result=mysqli_query($conn,$sql);
$row=mysqli_fetch_assoc($result);?><html>
<body>
<form action="update.php" method="post">
编号:<input type="text" name="id" value="<?=$row['id']?>" readonly="true" /><br/>
用户名:<input type="text" name="username" value="<?=$row['username']?>"/><br/>
密码:<input type="text" name="password" value="<?=$row['password']?>"/><br/>
<input type="submit" value="确定"/>
<input type="reset" value="取消"/>
</form>
</body>
$id=$_GET["id"]; $conn=mysqli_connect("localhost","root","","test");
$sql="select * from login where id=".$id;
$result=mysqli_query($conn,$sql);
$row=mysqli_fetch_assoc($result);?><html>
<body>
<form action="update.php" method="post">
编号:<input type="text" name="id" value="<?=$row['id']?>" readonly="true" /><br/>
用户名:<input type="text" name="username" value="<?=$row['username']?>"/><br/>
密码:<input type="text" name="password" value="<?=$row['password']?>"/><br/>
<input type="submit" value="确定"/>
<input type="reset" value="取消"/>
</form>
</body>
解决方案 »
- 我下载了pdt allin one,怎么看不到php project?怎么配置,才能开发PHP?
- 哪位大哥推荐一个PHP邮件类啊?
- 当在一个类中用 preg_replace 碰上了 $this时,悲剧发生了,请高手帮帮忙。
- cou是我得到总共的记录,我想在这上面再加500 该如何写呢
- 有用PHP做过大型B/S开发的请进
- 好恐怖!我的MYSQL里面怎么会是这个样子!!!
- PHP和Oracle
- 如何搜索出一个表中的数据,并且符合另一个表的条件?
- 可以在HTML代码中调用php变量吗? 对你而言可能很简单!!!
- 请大侠帮我解决一个数据库的问题
- 网站PHP文件框架不能在IE正确显示
- 求助,查询MYSQL问题
while($row=mysqli_fetch_array($result))
{
echo $row[字段名];
} 现在就没有问题了。
如果按id查出来是多条记录,那就按三楼的写法。具体位置,lz自己看手册吧