C'e qualcuno che i sa spiegare perchè mi il mio server xampp mi da questo warning?
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
questo e' lo script:
config.inc.php :
Codice PHP:
<?php
class php{
function connetti(){
$server_host = "localhost";
$server_user = "root";
$server_password ="";
$server_database="artistidelweb_it";
$connessione = mysql_connect($server_host,$server_user,$server_password) or die (mysql_error());
mysql_select_db($server_database,$connessione) or die(mysql_error());
}
function totUtenti(){
$this->connetti();
$sqlNumUtenti = "SELECT utenti FROM tbl_utenti";
$dati = mysql_query($sqlNumUtenti);
$utenti = mysql_fetch_array($dati,MYSQL_BOTH);
if(($utenti)!=0){
do {
echo "<td>";
echo $utenti['username'];
echo "</td>";
}
while ($utenti = mysql_fetch_array($dati));
}
}
}
?>
utenti.php
Codice PHP:
<?php
$php = new php();
$php->totUtenti();
?>
questo script dovrebbe stampare la colonna utenti della tabella tbl_utenti ma mi da errore di warning. non capisco perchè!
Un saluto a tutti!