 <p>query is empty because you are checking </p> <pre><code>`if (isset($_POST['EntryId1']))` instead of `if (isset($_POST['search']) &amp;&amp; $_POST['search']=='EntryId1')` and switch case would be b`enter code here`etter in this scenario. </code></pre>