<input type="submit" value=" search " name=search class="button_samll round orange" />
<?php
$con = mysql_connect('localhost','bank','1234');
if (!$con) {
die('Could not connect to MySQL: ' . mysql_error());
}
mysql_select_db("bank",$con);
if (isset($_POST['update']))
{
$updatequery="UPDATE customer SET customer_id='$_POST[customer_id]',rdate='$_POST[rdate]' WHERE member_id ='$_POST[hidden]'";
mysql_query($updatequery,$con);
}
if(isset($_POST['search']))
{
$rem = $_POST['term'];
$sql = "select * from customer where member_id like '$rem'";
$mydata = mysql_query($sql,$con);
echo "<center>";
echo '<table border=1 width="70%" border-spacing=0px;>
<tr>
<th>Member ID</th>
<th>FirstName</th>
<th>Mobile No.</th>
<th>Renewal Date</th>
</tr>';
while ($record = mysql_fetch_array($mydata))
{
echo "<form action=update.php method=post>";
echo "<tr>";
echo "<td>" . $record['member_id'] . " </td>";
echo "<td>" . $record['firstname'] . " </td>";
//echo "<td>" . "<input type=text name=lastname value=" . $record['lastname']. " </td>";
echo "<td>" . "<input type=text name=customer_id value=" . $record['customer_id']. " </td>";
//echo "<td>" . "<input type=text name=city value=" . $record['city'] . " </td>";
//echo "<td>" . "<input type=text name=adate value=" . $record['adate'] . " </td>";
echo "<td>" . "<input type=text name=rdate value=" . $record['rdate'] . " </td>";
echo "<td>" . "<input type=hidden name=hidden value= " . $record['member_id'] . " </td>";
echo '<td>' . '<input type=submit name=update value=Update class="button_small green">' . ' </td>';
echo "</tr>";
echo "</form>";
}
echo "</table>";
echo "</center>";
echo '<p><br>
<hr><br>
<p><br>';
}
mysql_close($con);