MantisBT: master 33170d2d

Author Committer Branch Timestamp Parent
vincent_sels vincent_sels master 2012-02-07 07:49 master c8a0c592
Affected Issues  0014336: Don't throw error when using db_fetch_array on empty resultset
Changeset

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 0014336

Signed-off-by: Damien Regad damien.regad@merckgroup.com

mod - core/database_api.php Diff File