print_r($rows)显示也的结果:
Array ( [0] => Array ( [0] => 1 [id] => 1 [1] => 1 [category_id] => 1 [2] => 凤惑天下 [name] => 凤惑天下 [3] => 简介省略 [description] => 简介省略 [4] => 206013.jpg [pic] => 206013.jpg ) )为什么在table里面
<input type="text" name="id" value="<?php echo $rows[id]?>" size="40" maxlength="40" /></th></tr>没有显示呢
请各位朋友帮忙 ....................急
<?php
include_once("getconn.php");
$id = $_GET['id'];
if(!empty($id)){
$sql="select * from picture where id='$id'";
$rows=$con->query($sql);
print_r($rows);}
?><table broder="1"><tr><th>编号:</th><th>
<input type="text" name="id" value="<?php echo $rows[id]?>" size="40" maxlength="40" /></th></tr>
<input type="text" name="id" value=" <?php echo $rows['id']?>" size="40" maxlength="40" />
Array ( [0] => Array ( [0] => 1 [id] => 1 [1] => 1 [category_id] => 1 [2] => 凤惑天下 [name] => 凤惑天下 [3] => 简介省略 [description] => 简介省略 [4] => 206013.jpg [pic] => 206013.jpg ) )<table broder="1">
<tr> <th>编号: </th> <th>
<input type="text" name="id" value=" <?php echo $rows[id]?>" size="40" maxlength="40" /> </th> </tr>
-------------------------------请注意红色部分,应该是$rows[0]['id']才对吧?