You are here

function referral_get_user in User Referral 7

Same name and namespace in other branches
  1. 5 referral.module \referral_get_user()
  2. 6 referral.module \referral_get_user()

Get referring user's uid for a given user

Parameters

$uid The user ID of the user who we want fetch its referrer.:

File

./referral.module, line 210
The referral module.

Code

function referral_get_user($uid) {
  $referral_uid = FALSE;
  $result = db_query('SELECT referral_uid FROM {referral} WHERE uid = :uid', array(
    ':uid' => $uid,
  ));
  foreach ($result as $data) {
    $referral_uid = $data->referral_uid;
  }
  return $referral_uid;
}