Hi there, need you help plz.
I m developing a hospital management website demo,
this is my patient registration form->
<?php include("include/header.php"
;?>
<?php include("include/leftbar.php"
;?>
<div id="center-column">
<div class="top-bar">
<h1>Patient Registration Form</h1>
</div><br />
<div class="select-bar"> </div>
<form action="insert_p_register.php" method="post" enctype="multipart/form-data">
<table>
<tr>
<td>First Name</td>
<td><input type="text" name="fname" required/> </td>
</tr>
<tr>
<td>Last Name </td>
<td><input type="text" name="lname" required/> </td>
</tr>
<tr>
<script type="text/javascript" src="countries.js"></script>
<td>Country </td>
<td>
<select onchange="print_state('state',this.selectedIndex);" id="country" name ="country" style="width:57%;" required></select>
<br />
</td>
</tr>
<tr>
<td>State</td>
<td>
<select name ="state" id ="state" style="width:57%;" required></select>
<script language="javascript">print_country("country"
;</script>
</td>
</tr>
<tr>
<td><input type="submit" style="width:60%;color:#000; font-size:large"/> </td>
</tr>
</table>
</form>
</div>
After registration, i have "display_all_patients" detail page, in which i have given a link to edit, hre the page ->
<?php include("include/header.php"
;?>
<?php include("include/leftbar.php"
;?>
<div id="center-column">
<div class="top-bar">
<h1>Registered Patients Details</h1>
</div><br />
<div class="select-bar"> </div>
<form>
<?php
include("include/connection.php"
;
$select= "select * from p_registration";
$query= mysql_query($select);
while($row=mysql_fetch_array($query))
{
@$fnm.='<td>'.$row['fname'].'</td>';
@$lnm.='<td>'.$row['lname'].'</td>';
@$country.='<td>'.$row['country'].'</td>';
@$state.='<td>'.$row['state'].'</td>';
@$edit.='<td>'. '<a href="edit_patient.php?p_id='.$row['id'].'">EDIT</a>'.'</td>';
}
echo '
<table style="font-size:14px; border: 5px solid #FF6600;" cellspacing="11px">
<tbody>
<tr>
<td><b>First Name</td>'.$fnm .'
</tr>
<tr>
<td><b>Last Name</td>'.$lnm .'
</tr>
<tr>
<td><b>Country</td>'.$country .'
</tr>
<tr>
<td><b>State</td>'.$state .'
</tr>
<tr>
<td><b>Edit</td>'.$edit .'
</tr>
</tbody>
</table>';
?>
</form>
</div>
My problem is, when i am clicking on the "Edit link", i am getting all the values to edit accept the "state" dropdown.
here is the "edit_patient_details" page ->
<?php include("include/header.php"
;?>
<?php include("include/leftbar.php"
;?>
<div id="center-column">
<script type="text/javascript" src="countries.js"></script>
<script language="javascript">print_country("country"
;</script>
<div class="top-bar">
<h1>Edit Patients Details</h1>
</div><br />
<div class="select-bar"> </div>
<?php
$p_id= $_GET['p_id'];
include("include/connection.php"
;
$select= "select * from p_registration where id='$p_id'";
$data= mysql_query($select);
$row= mysql_fetch_array($data);
@$fnm.='<td>'. '<input type="text" name="fname" value="'.$row['fname'].'"/>'.'</td>';
@$lnm.='<td>'.'<input type="text" name="fname" value="'.$row['lname'].'"/>'.'</td>';
@$country.='<td>'.'<select onchange="print_state('."state".',this.selectedIndex);" id="country" name ="country" style="width:57%;" required>
</select>'.'
<br />'.'</td>';
@$state.='<td>'.'<select name ="state" id ="state" style="width:57%;" required></select>'.'<script language="javascript">print_country("country"
;</script>'.'</td>';
echo '
<table style="font-size:14px; border: 5px solid #FF6600;" cellspacing="11px">
<tbody>
<tr>
<td><b>First Name</td>'.$fnm .'
</tr>
<tr>
<td><b>Last Name</td>'.$lnm .'
</tr>
<tr>
<td><b>Country</td>'.$country .'
</tr>
<tr>
<td><b>State</td>'.$state .'
</tr>
<tr>
<td><b>Update</td>'.$update .'
</tr>
</tbody>
</table>';
?>
</div>
.... Please help....
Thanx
Ritika