I have a search.php
in this I'm searching for three fields:
- Form no.
- Name
- Telephone no.
But when I select a From no.
, from select option and enter in input a Telephone no.
and press the search button it search for telephone no. instead of form no.
I want a search like when I select From no.
and enter a value of than it should search only for form no nothing else and like all below two option:
serach.php
<div class="tleft">
<h2 class="tdilouge">Search Reports</h2><center>
<table class="tbleft">
<form action="searchbyform.php" method="get">
<thead>
<tr>
<td>
<select name="formnumber" id="formnumber" >
<option>Form No.</option>
<option>Name</option>
<option>Telephone No.</option>
</select>
</td>
<td><input type="text" name="formnumber" id="formnumber" placeholder="Enter" /></td>
<td><input type="submit" value="Search" /></td>
</tr>
</thead>
</form>
</table></center>
</div>
And this is submit.php
I have a proper connection of database and column is table name:
submit.php
<?php
$formnumber = $_GET['formnumber'];
$sql = "SELECT * FROM colomn WHERE FormNo = $formnumber OR ConsumerName = $formnumber OR TelephoneNo = $formnumber";
$query = mysql_query( $sql );
if(mysql_num_rows($query) == 0)
{
echo "no result found";
}
echo "<table>";
echo "<thead></thead>";
while( $row = mysql_fetch_array( $query ) )
{
echo "<tr></tr>";
}
echo "</table>";
?>