$sql="SELECT * FROM Users WHERE '$searchType' = '$search'";
searchType is the column and search is what I want to search for.
I have checked my form and it is posting the values but failing when it gets to my sql.
Successfully connected to the database Types: - cusNamevalue: - Fred0 search results
<form id="form1" name="form1" method="POST" action="search.php">
<p>
<label for='name' >Search for a customer: </label>
<input type='text' name='search' id='customername' maxlength="45" required/>
</p>
<input type="hidden" name="searchType" value="cusName"/>
<input type='submit' name='submit' value='Submit'/>
</form>