Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我用MySQL得到了空结果_Mysql - Fatal编程技术网

我用MySQL得到了空结果

我用MySQL得到了空结果,mysql,Mysql,我已经尝试在MySQL中显示整个表数据。行为(用户名、姓氏和部门)。刷新页面时没有结果 <?php $servername = "fdb19.awardspace.net"; $username = "2598428_db"; $password = "password"; $dbname = "2598428_db"; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->conne

我已经尝试在MySQL中显示整个表数据。行为(用户名、姓氏和部门)。刷新页面时没有结果

<?php
$servername = "fdb19.awardspace.net";
$username = "2598428_db";
$password = "password";
$dbname = "2598428_db";


$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

$sql="SELECT * From users";
$result = $conn->query($sql);
while($res = mysqli_fetch_array( $result )) {
echo $res['AverageSatisfactionScore'];
} 

?>

您的回音是错误的

您需要显示有效的列名,如:
echo$res['id']
echo$res['dept']

只需打印您的结果集的总计数即可

echo mysqli\u num\u行($result)

它将打印结果中的记录总数

也可以尝试按顺序打印整行

print\r($res)

不用

echo$res['AverageSatisfactionScore']