opencart/opencart — pull request #1267 by pine3ree (2014-03-19 13:38:54+00:00)
Title: mysqli_result::num_rows

Please verify.
If you still use php 5.2 but want to switch to mysqli driver $query->num_rows will not be set before fetching the rows.
For mysqli : a SELECT (and SHOW and DESCRIBE) statement will always return a mysqli_result, in other cases it will return a boolean, so we could just check the return type.