Where clause in PHP doesn't work with variable
<p>I am learning PHP and have been trying to make this following work for some time but no luck. </p>

<pre><code>$sql = "SELECT * FROM add_employee WHERE employee_id='".$employee_id."'";
</code></pre>

<p>I am getting this following error:</p>

<pre><code>Notice: Undefined variable: employee_id in www/suman/payroll_process.php on line 12
</code></pre>

<p>I know the employee id I entered is in the database. When I hard coded employee_id='100', the query got a return. </p>

<p>How should I get the value in the variable and where should u this variable</p>
