use Joomla\CMS\Factory;
$db = Factory::getDbo();
$query = "SELECT parent_id FROM #__affiliate_tracker_accounts where user_id='[user_id]' ";
$db->setQuery($query);
$comid= $db->loadResult();
$query = "SELECT a.firstname, a.lastname, a.user_id FROM #__comprofiler a inner join #__affiliate_tracker_accounts b on b.user_id=a.id where b.id='$comid' ";
$db->setQuery($query);
$comProfiler_user= $db->loadObject();
$nom = $comProfiler_user->lastname;
$prenom = $comProfiler_user->firstname;
$userid = $comProfiler_user->user_id;
echo '<a href="profil/'.$userid.'" >'.$prenom.' '.$nom.'</a>';
Please Log in to join the conversation.
global $_CB_database;
$query = "SELECT " . $_CB_database->NameQuote( 'parent_id' )
. " FROM " . $_CB_database->NameQuote( '#__affiliate_tracker_accounts' )
. " WHERE " . $_CB_database->NameQuote( 'user_id' ) . " = " . $user->getInt( 'id', 0 );
$_CB_database->setQuery( $query );
$comid = $_CB_database->loadResult();
$query = "SELECT cb." . $_CB_database->NameQuote( 'firstname' )
. ", cb." . $_CB_database->NameQuote( 'lastname' )
. ", cb." . $_CB_database->NameQuote( 'user_id' )
. " FROM " . $_CB_database->NameQuote( '#__comprofiler' ) . " AS cb"
. " INNER JOIN " . $_CB_database->NameQuote( '#__affiliate_tracker_accounts' ) . " AS a"
. " ON a." . $_CB_database->NameQuote( 'user_id' ) . " = cb." . $_CB_database->NameQuote( 'id' )
. " WHERE a." . $_CB_database->NameQuote( 'id' ) . " = " . (int) comid;
$_CB_database->setQuery( $query );
$comProfiler_user = $_CB_database->loadObject();
Please Log in to join the conversation.
Please Log in to join the conversation.