function select_user($cible, $type) { if ( $type == 1 ) $prefix_table = "gr_"; else $prefix_table = ""; $sql = "SELECT text FROM ".$prefix_table."groupe WHERE id = '" . $cible . "' OR nom = '" . $cible. "'"; $liste_id_user = _query_select_one($sql, "text"); $where = ($liste_id_user) ? "id=" . str_replace("|", " OR id=", $liste_id_user) : " id = '-1'"; $sql = "SELECT * FROM ".$prefix_table."user WHERE " . $where; $res = _query_select($sql); return $res; }
function get_name_by_email($email) { $sql = "SELECT CONCAT(prenom, ' ', nom) AS name FROM user WHERE email = '". $email . "' "; $name = _query_select_one($sql, "name"); return $name; }