$recordSet = &$conn->Execute('SELECT id, name FROM table WHERE parent_id IS NULL'); if ($recordSet) while (!$recordSet->EOF) { list($id,$name) = $recordSet->fields; }