deprecated call to db_fetch_object

also clean up some places where we could $result->fetchAll

Change-Id: Ideb6c8afeb73a172d62dc4039d6ce8177f20cc78