[PHP/MySQL] Errore in funzione con query
Ciao a tutti, ho un problema: sto cercando di fare una query con un while che mostra tutti i risultati dentro una funzione (menu()) ...ma questa mi da questo errore:
Citazione:
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in index.php on line 21
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in index.php on line 21
Notice: Undefined variable: menuq in index.php on line 21
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in index.php on line 23
questo invece è il codice:
Codice PHP:
function menu() {
$menuq = mysql_query("SELECT * FROM categorie");
$return = "<li><a href=\"index.php\">Home</a></li>";
while($menu = mysql_fetch_array($menuq)) {
$return .= "<li><a href=\"index.php?cat=$menu[id]\">$menu[nome]</a></li>";
}
return $return;
}
Dove sto sbagliando? xD Grazie mille...ciao Davide! :wink: