 <p>I am 100% agree with nickL you have some formating issue in your query try to replace your search query by this:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code> $firstname=$_POST['firstname']; $surname=$_POST['surname']; $query = "SELECT * FROM lEmployee WHERE FirstName LIKE '%".$firstname."%' OR Surname LIKE '%".$surname."%'"; $q=mssql_query($sql);</code></pre> </div> </div> php is a case sensitive language your post variables name are wrong replace the code and try again, if not succeeded try echo $query and run it in query browser in sql server.</p> <p>hope this will fix the issue. </p>