title: Fetching results in PDO WHERE
body: <p>I'm trying to fetch a number where the user ID = the session ID.  For example, if the User ID = 1, I want to fetch the amount of bets the user has.</p>
  
  <p>I tried using MySQL's COUNT but it's not giving the proper result.  What am I doing wrong?</p>
  
  <p>![][1]<a href="http://puu.sh/3KYVf.png" rel="nofollow">http://puu.sh/3KYVf.png</a></p>
  
  <pre><code>&lt;?php
  include_once('db.php');
  session_start();
  
      $selectTotalBets = $db-&gt;prepare("SELECT COUNT(*) FROM `users` WHERE `uid` = :uid");
  
          $selectTotalBets-&gt;execute(array(':uid' =&gt; $_SESSION['uid']));
  
              $TotalBetsRow = $selectTotalBets-&gt;fetch();
  
                  $userTotalBets = $TotalBetsRow['uid'];
  
  
  
  ?&gt;
  </code></pre>