Ich bekomme folgende Fehlermeldung:
~~~~~~~~~~~~~~
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in
I:\xampp\htdocs\stefan\league\files\functions.php on line 39
Warning: Invalid argument supplied for foreach() in
I:\xampp\htdocs\stefan\league\files\functions.php on line 40
~~~~~~~~~~~~~~
bei diesem Code
und ich komm nicht drauf warum?
~~~~~~~~~~~~~~
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in
I:\xampp\htdocs\stefan\league\files\functions.php on line 39
Warning: Invalid argument supplied for foreach() in
I:\xampp\htdocs\stefan\league\files\functions.php on line 40
~~~~~~~~~~~~~~
bei diesem Code
PHP-Code:
db_connect(); //connect zur DB
$db_name = "db_hi_league";
$SQL_code = "SELECT loginname FROM members";
send_sql($db_name, $SQL_code); //Funktion um mysql_db_query auszuführen // return = $res
$arr = mysql_fetch_array ($res, MYSQL_ASSOC);
foreach ($arr as $elem) {
echo "$elem <br>";
}
Kommentar