I have wordpress website and I made a page that shows the users and points from database, but it shows all the users,
I want the logged in user to see his point, getting it from his row in database. I mean when the user login with my website user can see his username and points , even can see in his profile page
Note : I am " using users ultra plugin " for profile page
I will show you code for display records from database , and it`s worknig
<?php
// make connecion
mysql_connect('localhost', 'root', '');
// Select Database
mysql_select_db ('Nourena');
$sql="SELECT sum(points) as sumpoints , name FROM wp_wp_pro_quiz_toplist group by name order by sumpoints DESC";
$records=mysql_query($sql);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>الاحصائيات النهائية لمسابقة اكتوبر</title>
</head>
<body>
<table class="wpProQuiz_toplistTable">
<tr>
<th style="width: 40px;">Pos.</th>
<th style="">Name</th>
<th style="width: 60px;">Points</th>
<tr>
<?php
$i=1;
while($wp_wp_pro_quiz_toplist=mysql_fetch_assoc($records)) {
echo "<tr>";
echo "<td>".$i++."</td>";
echo "<td>".$wp_wp_pro_quiz_toplist[name]."</td>";
echo "<td>".$wp_wp_pro_quiz_toplist[sumpoints]."</td>";
echo "</tr>";
}// End While
?>
</table>
</body>
</html>
and this is code for profile page after user logging in directly from ( users ultra membership plugin )
), $atts ) );
$html = "";
$users_list = $this->get_logged_in_user();
$html.='<div class="uultra-miniprofile-users">
<ul>';
foreach ( $users_list as $user )
{
$user_id = $user->ID;
if($pic_boder_type=="rounded")
{
$class_avatar = "avatar";
}
$html .= '<li class="'.$box_border.' '.$box_shadow.' '.$display.'" style="width:'.$item_width.'" >
<div class="prof-photo">
'.$this->get_user_pic( $user_id, $pic_size, $pic_type, $pic_boder_type, $pic_size_type).'
</div>
<div class="info-div">
<p class="uu-direct-name"><a class="uultra-btn-profile" href="'.$this->get_user_profile_permalink( $user_id).'">
'. $this->get_display_name($user_id).' </a> <span>'.$this->get_user_country_flag($user_id).'</span></p> ';
if ($optional_fields_to_display!="")
{
$html .= $this->display_optional_fields( $user_id,$display_country_flag, $optional_fields_to_display);
}
$html .= '<div class="tool-div-bar"><a class="uultra-btn-profile" href="'.$this->get_user_profile_permalink( $user_id).'" '.__('See Profile','xoousers').'><i class="fa fa-eye fa-lg"></i> </a>
<a class="uultra-btn-profile" href="'.$xoouserultra->get_logout_url().'" title="'.__('Logout','xoousers').'"> <i class="fa fa-power-off fa-lg"></i> </a> </div> ';
$html .= '</div> ';
$html .=' </li>';
} //end foreach
finally I want the logged in user to see his point, getting it from his row in database.