Check if there's a content type published How can I check (via PHP code) if a content type is published?

I have a content type called 'House' and a content type called 'People'. On the 'People' content type, there's a field called 'House'. If the user didn't publish a 'House' content type yet, I want to hide this field.

I thought I could do it by using a hook_form_alter, isn't it possible? If it is, I just don't know how to check if a content type was published or not. Something like: if (isset($node->type == 'House')) ... Of course it doesn't work.

Do you have any suggestions?
Something like this?

hook_form_alter() {
  /* check that you're looking at the right form here.. */
    global $user;
    $type_to_check = 'House';

    $query = db_query("SELECT nid FROM node n JOIN users u ON n.uid = u.uid WHERE n.status = 1 AND u.uid = %d AND n.type = '%s'", $user-&gt;uid, $type_to_check);

    if(empty(db_result($query))) {
      /* kill the thing you don't want here */
    }
}