Fix for infinite loop problem with successive calls to ->fetchRow()