title: SQL Fetching single scalar using PDO
body: <p>This question is more on <a href="https://stackoverflow.com/questions/13424009/updating-sql-column">this post</a>. So I want to retrieve the number in a certain column. So let's say the table looks like this:</p>
  
  <pre><code>A | B | C | D | E | F
  ---------------------
  0 | 50| 0 | 0 | 0 | 0
  </code></pre>
  
  <p>Let's say the user enters in <code>B</code>, I want to go fetch the current number in the table, which is <code>50</code>. This is my SQL code:</p>
  
  <pre><code>$link = new PDO('**;dbname=**;charset=UTF-8','**','**');
  $stmt = $link-&gt;prepare("SELECT MAX(:type) as max FROM table");
  $stmt-&gt;bindParam(':type', $type);
  $stmt-&gt;execute();
  $used = $stmt-&gt;fetch(PDO::FETCH_ASSOC);
  $used = $used["max"];
  </code></pre>
  
  <p>But this is just returning <code>B</code> rather than the number. How do I change my code to get the number? Thanks</p>