title: Retrieving data belonging to a session and user id
body: <p>I am trying to obtain data from the current session and the field "bidder_id" from tbl_bidder where the field "accept" has the value Accepted, but I get data of all the users in that table which is not I want. This is my code</p>
  
  <pre><code> &lt;?php } else if (($_SESSION['Usertype']) == 'recruiter') { ?&gt;
      &lt;table class="table table-hover"&gt;
          &lt;?php
              $u_id = $_SESSION['UserID'];
              $notifyR = " SELECT bidid, recbid_id, bidder_id, selected, accept FROM tbl_bides WHERE recbid_id  = '" . $u_id . "'";
  
              $ResultR = mysql_query($notifyR, $con);
  
              while ($rowR = mysql_fetch_array($ResultR)) {
                  if ($rowR['accept'] == "Accepted") {
                      echo "&lt;h3 style='color:#001F7A;'&gt;&lt;b&gt;You Have Updates &lt;/b&gt;&lt;i class='fa fa-bell-o'&gt;&lt;/i&gt;&lt;/h3&gt;";
                      echo $rowR['bidder_id'];
                  }
  
                  $recR = "SELECT users_id, first_name, last_name  FROM tbl_users WHERE users_id = '" . $rowR['bidder_id'] . "'";
                  $recResultB = mysql_query($recR, $con)or die(mysql_error());
  
                  while ($rowre = mysql_fetch_array($recResultB)) {
                      echo " &lt;tr&gt;&lt;td&gt;" . $rowre['first_name'] . " " . $rowre['last_name'] . "&lt;/td&gt;&lt;/tr&gt;";
  
                  }
              }
          ?&gt;
  </code></pre>
  
  <p>Please help!!!</p>