PHP-MySQLi-Database-Class
PHP-MySQLi-Database-Class copied to clipboard
getValue return NULL instead array
Hi, with this code:
$logins = $db->getValue ("users", "login", 5);
// select login from users limit 5
foreach ($logins as $login)
echo $login;
All is ok if results found. But if NO RESULT FOUND, we get error:
Warning: foreach() argument must be of type array|object, null given
Use is_array before doing foreach