title: How can I make the define the table name of an sql statement in php?
body: <p>I'm trying to set the table name in my sql statement in PHP</p>
  <pre><code>$stmt = $pdo-&gt;prepare(&quot;SELECT count(*) FROM ?&quot;);
  $stmt-&gt;execute([$table]);
  $count = $stmt-&gt;fetchColumn();
  </code></pre>
  <p>with what i tried i get: Fatal error: <code>Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation</code>
  If you know any solution to pass the table name in php it'll be very helpful! thanks in advance!</p>