1 Jun 2012 10:37
[mantisbt-commits] [mantisbt/mantisbt] 33170d: Don't throw error when using db_fetch_array on emp...
Branch: refs/heads/master Home: https://github.com/mantisbt/mantisbt Commit: 33170d2d54643e63b1a60b021dcb0cbbb45e4157 https://github.com/mantisbt/mantisbt/commit/33170d2d54643e63b1a60b021dcb0cbbb45e4157 Author: Vincent Sels <vincent_sels@...> Date: 2012-06-01 (Fri, 01 Jun 2012) Changed paths: M core/database_api.php Log Message: ----------- Don't throw error when using db_fetch_array on empty resultset When you execute a query which returns no results, an error is thrown when using db_fetch_array() on it, because the method tries to access the EOF property of an object which in that case is null. By adding an extra check on the passed p_result to see whether it is null, you can safely use db_fetch_array for instance in while loops, without having to always manually check whether or not the result has rows. This makes code more readable and faster. Fixes #14336 Signed-off-by: Damien Regad <damien.regad@...>
------------------------------------------------------------------------------(Continue reading)
RSS Feed