ThingEngineer / PHP-MySQLi-Database-Class

Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Other
3.3k stars 1.34k forks source link

getValue return NULL instead array #1037

Open itajackass opened 4 days ago

itajackass commented 4 days ago

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