"SELECT ph.display_tel AS cell, a.naissance AS age
FROM auth_user_md5 AS a
INNER JOIN auth_user_quick AS q USING (user_id)
- LEFT JOIN profile_phones AS ph ON (ph.uid = a.user_id AND link_type='user' AND tel_type = 'mobile')
+ LEFT JOIN profile_phones AS ph ON (ph.pid = a.user_id AND link_type='user' AND tel_type = 'mobile')
WHERE a.matricule = {?} LIMIT 1", $params[1]);
$array = $res->next();
} else {
explode("\n", Geocoder::getFirstLines($text, $adr['cp'], 3));
$sql = XDB::query("SELECT display_tel
FROM profile_phones
- WHERE uid = {?} AND link_type = 'user' AND tel_type = 'mobile'
+ WHERE pid = {?} AND link_type = 'user' AND tel_type = 'mobile'
LIMIT 1", $uid);
if ($sql->numRows() > 0) {
$array['cell'] = $sql->fetchOneCell();
"SELECT t.display_tel AS tel, t.tel_type, t.link_id as adrid
FROM profile_phones AS t
INNER JOIN profile_addresses AS a ON (t.link_id = a.id AND t.uid = a.pid)
- WHERE t.uid = {?} AND t.link_type = 'address'
+ WHERE t.pid = {?} AND t.link_type = 'address'
AND NOT FIND_IN_SET('pro', a.statut)", $uid);
while ($tel = $restel->next()) {
$array['adresse'][$adrid_index[$tel['adrid']]]['tels'][] = $tel;
"SELECT a.nom, a.nom_usage,a.prenom, FIND_IN_SET('femme', a.flags) as femme,
a.deces!= 0 as decede, a.naissance, a.promo, concat(al.alias, '@m4x.org') as mail
FROM auth_user_md5 AS a
- INNER JOIN aliases AS al ON (a.user_id = al.id)
+ INNER JOIN aliases AS al ON (a.user_id = al.uid)
WHERE al.flags = 'bestalias' AND a.matricule = {?}",$params[1]);
$data=$res->fetchOneAssoc();
//$data['mail'].='@polytechnique.org';