title: Column not found in where clause
body: <p>I am to php and I am trying to make a page where you can see the public uploads that are stored in a mysql server.</p>
  
  <p>Out of not where the code I have been using starts giving me an error: </p>
  
  <blockquote>
    <p>SQLSTATE[42S22]: Column not found: 1054 Unknown column 'public' in 'where clause'</p>
  </blockquote>
  
  <p>I am trying to see how many rows in my db have 'public'</p>
  
  <pre><code>// Find out how many items are in the table
  $p = 'public';
  $total = $db-&gt;query("SELECT COUNT(*) FROM uploads WHERE world_access = $p")-&gt;fetchColumn();
  </code></pre>
  
  <p>I don't know if it is the php or the sql.</p>
  
  <pre><code>// Prepare the paged query
  $stmt = $db-&gt;prepare('SELECT * FROM uploads WHERE world_access = :y ORDER BY upload_time DESC LIMIT :limit OFFSET :offset');
  // Bind the query params
  $stmt-&gt;bindParam(':y', $p, PDO::PARAM_INT);
  $stmt-&gt;bindParam(':limit', $limit, PDO::PARAM_INT);
  $stmt-&gt;bindParam(':offset', $offset, PDO::PARAM_INT);
  $stmt-&gt;execute();
  </code></pre>
  
  <p>pagination by <a href="https://stackoverflow.com/questions/3705318/simple-php-pagination-script">Simple PHP Pagination script</a></p>