Запрос в drupal 6

db_query("SELECT us.name
                         FROM {user_relationships} ur
                         INNER JOIN {users} us ON ur.requestee_id = us.uid
                         WHERE ur.requester_id = '%s' AND ur.approved = %d"
, $uid, 1);

%s - means string

%d -means integer

%b - means Binary

%% -means Inserts a literal % sign

%f - means Float

while ($item = db_fetch_object($result)) {
            $options[$item->name] = $item->name;
        }