提示$data=mysqli_fetch_row($result);有错,请问怎么改呢?
<?php//1,连接$conn=mysqli_connect("localhost","root","root");if(mysqli_connect_errno($c...
<?php
//1,连接
$conn=mysqli_connect("localhost","root","root");
if(mysqli_connect_errno($conn))
die("无法链接到服务器");
//2,选择数据库
mysqli_select_db($conn,"xuexi51")or die("error");
//3,SQL查询
$sql="SELECT*,FROM liuyanban";
$result=mysqli_query($conn,$sql);
$data=mysqli_fetch_row($result);
print($data);
mysqli_close($conn);
?> 展开
//1,连接
$conn=mysqli_connect("localhost","root","root");
if(mysqli_connect_errno($conn))
die("无法链接到服务器");
//2,选择数据库
mysqli_select_db($conn,"xuexi51")or die("error");
//3,SQL查询
$sql="SELECT*,FROM liuyanban";
$result=mysqli_query($conn,$sql);
$data=mysqli_fetch_row($result);
print($data);
mysqli_close($conn);
?> 展开
1个回答
展开全部
<?php
//1,连接
$conn=mysqli_connect("localhost","root","root");
if(mysqli_connect_errno($conn))
die("无法链接到服务器");
//2,选择数据库
mysqli_select_db($conn,"xuexi51")or die("error");
//3,SQL查询
$sql="SELECT * FROM liuyanban";//多了个,
$result=mysqli_query($conn,$sql);
$data=mysqli_fetch_row($result);
print_r($data); //print不能打印数组
mysqli_close($conn);
?>
//1,连接
$conn=mysqli_connect("localhost","root","root");
if(mysqli_connect_errno($conn))
die("无法链接到服务器");
//2,选择数据库
mysqli_select_db($conn,"xuexi51")or die("error");
//3,SQL查询
$sql="SELECT * FROM liuyanban";//多了个,
$result=mysqli_query($conn,$sql);
$data=mysqli_fetch_row($result);
print_r($data); //print不能打印数组
mysqli_close($conn);
?>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询