我这个代码用了mysqli了为什么还是提示这个呢??
哪里不对<?php$con=mysqli_connect("localhost","root","","t1");if(mysqli_connect_errno($con...
哪里不对
<?php
$con =mysqli_connect("localhost","root","","t1");
if (mysqli_connect_errno($con))
{
die('Could not connect: ' . mysql_error());
}
mysqli_query($sql,$con);
$sql='select*from stu';
$rs=mysqli_query($sql,$con);
$list=array();
while($row=mysql_fetch_assoc($rs)){
$list[]=$row;
}
echo '$sql'
?>
<html>
<head>
<style type="text/css">
li{list-style: none;display: block;float: left;}
ul{both:clear;}
</style>
</head>
<body>
<div>
<ul>
<li>学号</li>
<li>姓名</li>
<li>年龄</li>
</ul>
<ul>
<?php
foreach($list as $v){
echo '<li>'.$v['id'].'</li>';
echo '<li>'.$v['name'],'</li>';
echo '<li>'.$v['num'].'</li>';
echo '<li><a href="1.php?id='.$v['id'].'">编辑</a></li>';
}
?>
</ul>
</div>
</form>
</body>
</html> 展开
<?php
$con =mysqli_connect("localhost","root","","t1");
if (mysqli_connect_errno($con))
{
die('Could not connect: ' . mysql_error());
}
mysqli_query($sql,$con);
$sql='select*from stu';
$rs=mysqli_query($sql,$con);
$list=array();
while($row=mysql_fetch_assoc($rs)){
$list[]=$row;
}
echo '$sql'
?>
<html>
<head>
<style type="text/css">
li{list-style: none;display: block;float: left;}
ul{both:clear;}
</style>
</head>
<body>
<div>
<ul>
<li>学号</li>
<li>姓名</li>
<li>年龄</li>
</ul>
<ul>
<?php
foreach($list as $v){
echo '<li>'.$v['id'].'</li>';
echo '<li>'.$v['name'],'</li>';
echo '<li>'.$v['num'].'</li>';
echo '<li><a href="1.php?id='.$v['id'].'">编辑</a></li>';
}
?>
</ul>
</div>
</form>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询