Php 警告:mysql_fetch_array()希望参数1是资源,字符串为HELPPP

Php 警告:mysql_fetch_array()希望参数1是资源,字符串为HELPPP,php,mysql,mysqli,mysql-error-1064,Php,Mysql,Mysqli,Mysql Error 1064,代码如下: <?php require_once('config.php'); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Elenco Frattali</title> </head> <body> <h1> Inizio pagina

代码如下:

<?php 
require_once('config.php'); 
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Elenco Frattali</title>
</head>

<body>


<h1> Inizio pagina </h1>
<?php
$sel = "SELECT immagini.id AS id, immagini.name AS nome
        FROM immagini"  ;


$ris = mysqli_query($con,$sel);  
$count = mysqli_num_rows($ris); 


if($count >= 1)  
    echo "<h1>Elenco Studenti: </h1>";

while ( $riga=mysql_fetch_array($sel)) {   
    echo "<h3>".$riga['id']."</h3>";
       }

?>


<br>

<?php                       //chiudo while  
mysqli_close($con); //chiudo connessione
?>  
</body>
</html>

埃伦科兄弟会
帕吉纳酒店

当($riga=mysql\u fetch\u array($sel)){时,错误出现在这一行

错误是这样的:

mysql_fetch_array()希望参数1是给定的资源字符串


在这个数据库上,我使用一个带有BLOB的表(用于存储图像),如果您需要知道的话。HELPPPP在同一行代码中有两个错误:

1) 您正在混合mysql和MySQLIAPI,这是您无法做到的

2) 您正在将查询传递给函数而不是结果资源:

while($riga = mysql_fetch_array($sel)) {   
应该是:

while($riga = mysqli_fetch_array($ris)) {   
                 //^             ^^^^

杜松子酒和汤能很好地混合在一起,但不具备mysql和mysqli的功能。