Eroare site CMS
Scris: Mie Aug 10, 2011
Salutare,
am descarcat exemplul de site CMS de aici: https://marplo.net/php-mysql/creare_site_cms.html" target="_blank .
Si primesc o eroare: Notice: 256 in C:\Program Files\EasyPHP-5.3.6.1\www\Site CMS\admin.php on line 57
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\Program Files\EasyPHP-5.3.6.1\www\Site CMS\admin.php on line 58
Iata functia:
Ma poate ajuta cineva ?
am descarcat exemplul de site CMS de aici: https://marplo.net/php-mysql/creare_site_cms.html" target="_blank .
Si primesc o eroare: Notice: 256 in C:\Program Files\EasyPHP-5.3.6.1\www\Site CMS\admin.php on line 57
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\Program Files\EasyPHP-5.3.6.1\www\Site CMS\admin.php on line 58
Iata functia:
Cod: SelectaĊ£i tot
function get_meniu() {
GLOBAL $conn;
// Selecteaza coloanele in care numele meniului e acelasi cu numele paginii
// Apoi adauga numele meniurilor intr-o variabila tip array
$q = "SELECT `meniu` FROM `pagini` WHERE `meniu`=`pagina`";
$result = mysql_query($q, $conn) or trigger_error(E_USER_ERROR); // Linia 57.
if (mysql_num_rows($result) == 0) { // Linia 58.
$menu = false;
}
else {
while ($rand = mysql_fetch_assoc($result)) {
// Elimina caracterele "\" care au fost adaugate de "mysql_real_escape_string()"
$menu[] = stripslashes($rand['meniu']);
}
}
return $menu;
}