Unknown column 'email_input' (PHP MySQLi Prepared Statement) : <p>I'm using MySQLiIn the <code>WHERE</code> clause of my statement I am adding parameters on RHS:</p>

<p>Prepared statement:</p>

<p><code>$sql = 'select * from emailstobeverified where email=email_input and verification_code=code_input;';</code></p>

<p>And then I use <code>$stmt-&gt;prepare($sql);</code></p>

<p>And I get a PHP error saying:</p>

<p><code>Sql Error: Unknown column 'email_input' in 'where clause'</code></p>

<p>(I thought that the LHS of the boolean expression counts as the column? )</p>

<p>the below query will work:</p>

<p><code>$sql = 'insert into emailstobeverified (email) values (:email);';</code></p>

<p>Here, I can use <code>:email</code> as a parameter, so I tried making <code>email_input</code> have a colon before it: <code>:email_input</code> and used that as the param. However I got a syntax error:</p>

<pre><code>Sql Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':email_input and verification_code=:code_input' at line 1
</code></pre>

<p>What's the correct syntax for comparing the table column value to some param?</p>
