PHP Classes

mysql_fetch_row/assoc return null instead of false

Recommend this page to a friend!

      PHP MySQL to MySQLi  >  All threads  >  mysql_fetch_row/assoc return null...  >  (Un) Subscribe thread alerts  
Subject:mysql_fetch_row/assoc return null...
Summary:mysql_fetch_row/assoc return null instead of false
Date:2018-06-01 11:38:56

  1. mysql_fetch_row/assoc return null...   Reply   Report abuse  
Picture of Jurgen Jurgen - 2018-06-01 11:38:56

In code that looks like this

while ((mysql_fetch_assoc($result)) !== FALSE) { .. }

we get endless loops, as the return value of mysqli_fetch_assoc is NULL and not FALSE

same goes for mysql_fetch_row and maybe others (did not check)