下拉列表和单选按钮在编辑表单时无法检索

时间:2016-02-23 12:56:36

标签: php html mysql form-submit

请帮帮我!!! 我正在创建一个包含所有插入更新删除操作的表单。直到我用文本框创建的时间一切都很好但是当我开始在性别和类别的下拉字段中使用单选按钮时,它开始给出问题。我对php没有太多的了解。我尝试在线使用很多选项,但无法修复。插入表单适用于下拉和单选按钮字段,但是当编辑下拉列表和单选按钮时,不会从数据库中检索其选定的值。下面是我的代码我找到了一些性别的选中选项,但它不起作用。请任何人检查我的代码并告诉我我错过了什么。

my edit.php code 
<!DOCTYPE html>
<html dir="ltr" lang="en-US"><head><!-- Created by Artisteer v4.0.0.58475 -->
    <meta charset="utf-8">
    <title>library</title>
    <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">
    <link href='https://sites.google.com/site/99webdemos/favicon.png' rel='shortcut icon' type='image/x-icon'/>
    <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <link rel="stylesheet" href="css/style.css" media="screen">
    <!--[if lte IE 7]><link rel="stylesheet" href="style.ie7.css" media="screen" /><![endif]-->
    <link rel="stylesheet" href="css/style.responsive.css" media="all">


    <script src="js/jquery.js"></script>
    <script src="js/script.js"></script>
    <script src="js/script.responsive.js"></script>
    <script type="text/javascript" language="JavaScript">
    jQuery(document).ready(function()
    {
      jQuery(".form-message").fadeOut(10000);
    });
    </script>
   

<style>.art-content .art-postcontent-0 .layout-item-0 { padding-right: 10px;padding-left: 10px;  }
.ie7 .post .layout-cell {border:none !important; padding:0 !important; }
.ie6 .post .layout-cell {border:none !important; padding:0 !important; }

</style></head>
<body>
<div id="art-main">
    <div id="art-header-bg" class="clearfix">
            </div>
    <div id="art-hmenu-bg" class="art-bar art-nav clearfix">
    </div>
    <div class="art-sheet clearfix">
<header class="art-header clearfix">


    <div class="art-shapes">
<h1 class="art-headline" data-left="0.5%">
    <a  href="http://www.99demos.blogspot.com" target="_blank">library</a>
</h1>
<h2 class="art-slogan" data-left="87.05%"><a href="http://99demos.blogspot.in/2014/06/createreadupdate-delete-with-image.html"></a></h2>


            </div>

<nav class="art-nav clearfix">
    <div class="art-nav-inner">
    <ul class="art-hmenu"><li><a href="index.php" class="active">Home</a></li></ul> 
        </div>
    </nav>

                    
</header>
<div class="art-layout-wrapper clearfix">
                <div class="art-content-layout">
                    <div class="art-content-layout-row">
                        <div class="art-layout-cell art-content clearfix"><article class="art-post art-article">
                                <h2 class="art-postheader">customer form</h2>
                                                
                <div class="art-postcontent art-postcontent-0 clearfix"><div class="art-content-layout">
    <div class="art-content-layout-row">
    <div class="art-layout-cell layout-item-0" style="width: 100%" >
        <br>
        
        
<?php
ob_start(); 
include('include/connect.php'); 
if(isset($_GET['id']))
{

	$qry = "SELECT * FROM tbl_emp where id=".$_GET['id'];
    $result = mysql_query($qry);
	$row = mysql_fetch_array($result);
	
    if($_SERVER["REQUEST_METHOD"] == "POST")
    {
        $name = $_POST["name"];
         $age = $_POST["age"];`enter code here`
         $gender = $_POST["gender"];
         $martial = $_POST["martial"];
         $contact = $_POST["contact"];
         $email = $_POST["email"];
          $location= $_POST["location"];
                          $category= $_POST["category"];
              
        IF($_FILES['file']['name']!='')
        {
				 $file='uploads/'.$row['image'];
				 @unlink($file);
           	     $tmp_name = $_FILES["file"]["tmp_name"];
            	 $namefile = $_FILES["file"]["name"];
				 $ext = end(explode(".", $namefile));
				 $image_name=time().".".$ext;
            	 $fileUpload = move_uploaded_file($tmp_name,"uploads/".$image_name);
		}
		else
		{
				$image_name=$row['image'];
		}
		
 	 	 $sqlAdd ="update tbl_emp set name='".$name."', age='".$age."', gender='".$gender."', martial='".$martial."', contact='".$contact."', email='".$email."', location='".$location."', category='".$category."', image='".$image_name."'  where id=".$_GET['id'];
	  	 mysql_query($sqlAdd);
         header("Location:add.php?id=".@$_GET['id']."&msg=success");
		 exit;
    }		
}
else
{
    if($_SERVER["REQUEST_METHOD"] == "POST")
    {
        $name = $_POST["name"];
       $age = $_POST["age"];
       $gender = $_POST["gender"];
        $martial = $_POST["martial"];
        $contact = $_POST["contact"];
         $email = $_POST["email"];
          $location= $_POST["location"];
                         $category= $_POST["category"];
               
        IF($_FILES['file']['name']!='')
        {
            $tmp_name = $_FILES["file"]["tmp_name"];
            $namefile = $_FILES["file"]["name"];
			$ext = end(explode(".", $namefile));
			$image_name=time().".".$ext;

            $fileUpload = move_uploaded_file($tmp_name,"uploads/".$image_name);
        }
        $sqlAdd = mysql_query("insert into tbl_emp(name,age,gender,martial,contact,email,location,category,image) VALUES('$name','$age','$gender','$martial','$contact','$email','$location','$category','$image_name')");
        header("Location:index.php?msg=success");
		exit;
    }
}
    ob_end_flush();
	
	if(isset($_GET['msg']))
	{
	?>
    <div style="color:red;padding-bottom:10px;" class="form-message" align="center"><b>Task completd successfully.</b></div>
    <?php	
	}
?>


<form  method="post" name="login" id="login" enctype="multipart/form-data">
 <table class="table" width="100%">
    <tr>
    <td width="10%">Customer Details</td>
    <td></td>
  </tr>
    <tr>
    <td width="10%">Full Name</td>
    <td><input name="name" type="text" placeholder="Firstname Lastname" pattern="[A-Za-z-0-9]+\s[A-Za-z-'0-9]+" required value="<?php echo @$row['name'];?>"></td>
  </tr>
 <tr>
    <td width="20%">Age</td>
    <td><input name="age" type="text" value="<?php echo @$row['2'];?>" ></td>
  </tr>
   <tr>
   <td>Gender</td>
 <td><input type="radio" name="gender" value="male" <?php if($result['gender']=="male"){ echo "checked";}?> >
 Male
 <input type="radio" name="gender" value="female" <?php if($result['gender']=="female"){ echo "checked";}?>>
 Female</td>
 </tr>
  <tr>
    <td width="10%">Martial Status</td>
    <td><input name="martial" type="text" value="<?php echo @$row['4'];?>" ></td>
  </tr>
  <tr>
    <td width="20%">Contact Number</td>
    <td><input name="contact" type="text" value="<?php echo @$row['5'];?>"></td>
  </tr>
   <tr>
    <td width="10%">Email Address</td>
    <td><input name="email" type="text" value="<?php echo @$row['6'];?>"></td>
  </tr>
  <tr>
    <td width="10%">Location</td>
    <td><input name="location" type="text" value="<?php echo @$row['7'];?>" ></td>
  </tr>
  
   <tr>
    <td width="10%">category</td>
    <td>
   <select name="category" id="category" value="<?php echo @$row['11'];?>">
    <option <?php if ($selected == 'select' ) echo 'selected'; ?> value="select">select</option>
    <option <?php if ($selected == '1' ) echo 'selected'; ?> value="1">1</option>
    <option <?php if ($selected == '2' ) echo 'selected'; ?> value="2">2</option>
    <option <?php if ($selected == '3' ) echo 'selected'; ?> value="3">3</option>
  </select>
    </td>
  </tr>
 
  <tr>
    <td width="10%"> Image</td>
    <td><input name="file" type="file" multiple="" ></td>
    
  </tr>
   <?php
   if(isset($row['image'])) 
   {
   ?>
   <tr>
        <td>&nbsp;</td>
        <td><img src="uploads/<?php echo $row['image'];?> " height="50" width="50"></td>
   </tr>
	<?php
	}
	?>
  <tr>
    <td>&nbsp;</td>
    <td>
    <input name="submit" value="Submit" type="submit" class="submit">
    <input name="submit" value="Cancel" type="button" class="submit" onClick="window.location='index.php'">
    </td>
  </tr>
</table>
</form> 
<a href="http://dme-medical.com/library/search.php">Go back to list</a>       
    </div>
    </div>
</div>
</div>
</article></div>
                    </div>
                </div>
            </div>
    </div>
<footer class="art-footer clearfix">
  <div class="art-footer-inner">
<p>Copyright © 2016. All Rights Reserved.</p>
    <p class="art-page-footer">
      
    </p>
  </div>
</footer>

</div>


</body></html> 

2 个答案:

答案 0 :(得分:0)

欢迎使用stackoverflow。

您的选择查询应该是这样的:

$qry = "SELECT * FROM tbl_emp where id=".$_GET['id'];
$result = mysql_query($qry,$conn);
while($row = mysql_fetch_array($result));
{

}

从数据库中检索单选按钮值:

<input type="Radio" name="gender" <?php if ($gender=='male') { echo 'checked'; } ?> />

要检索下拉菜单,您必须回显selected=selected

 <select name="category" id="category">
    <option <?php if ($category== '1' ) echo 'selected="selected'; ?> >1</option>
    <option <?php if ($category== '2' ) echo 'selected="selected'; ?> >2</option>
    <option <?php if ($category== '3' ) echo 'selected="selected'; ?> >3</option>
  </select>

一点点的研究可以得到你这个答案。 :)他们遍布stackoverflow。

答案 1 :(得分:0)

<--------------------new code start-------------------->
<!DOCTYPE html>
<html dir="ltr" lang="en-US"><head><!-- Created by Artisteer v4.0.0.58475 -->
    <meta charset="utf-8">
    <title>library</title>
    <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">
    <link href='https://sites.google.com/site/99webdemos/favicon.png' rel='shortcut icon' type='image/x-icon'/>
    <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <link rel="stylesheet" href="css/style.css" media="screen">
    <!--[if lte IE 7]><link rel="stylesheet" href="style.ie7.css" media="screen" /><![endif]-->
    <link rel="stylesheet" href="css/style.responsive.css" media="all">


    <script src="js/jquery.js"></script>
    <script src="js/script.js"></script>
    <script src="js/script.responsive.js"></script>
    <script type="text/javascript" language="JavaScript">
    jQuery(document).ready(function()
    {
      jQuery(".form-message").fadeOut(10000);
    });
    </script>
   
<style>.art-content .art-postcontent-0 .layout-item-0 { padding-right: 10px;padding-left: 10px;  }
.ie7 .post .layout-cell {border:none !important; padding:0 !important; }
.ie6 .post .layout-cell {border:none !important; padding:0 !important; }

</style></head>
<body>
<div id="art-main">
    <div id="art-header-bg" class="clearfix">
            </div>
    <div id="art-hmenu-bg" class="art-bar art-nav clearfix">
    </div>
    <div class="art-sheet clearfix">
<header class="art-header clearfix">


    <div class="art-shapes">
<h1 class="art-headline" data-left="0.5%">
    <a  href="http://www.99demos.blogspot.com" target="_blank">library</a>
</h1>
<h2 class="art-slogan" data-left="87.05%"><a href="http://99demos.blogspot.in/2014/06/createreadupdate-delete-with-image.html"></a></h2>


            </div>

<nav class="art-nav clearfix">
    <div class="art-nav-inner">
    <ul class="art-hmenu"><li><a href="index.php" class="active">Home</a></li></ul> 
        </div>
    </nav>

                    
</header>
<div class="art-layout-wrapper clearfix">
                <div class="art-content-layout">
                    <div class="art-content-layout-row">
                        <div class="art-layout-cell art-content clearfix"><article class="art-post art-article">
                                <h2 class="art-postheader">customer form</h2>
                                                
                <div class="art-postcontent art-postcontent-0 clearfix"><div class="art-content-layout">
    <div class="art-content-layout-row">
    <div class="art-layout-cell layout-item-0" style="width: 100%" >
        <br>
        
        
<?php
ob_start(); 
include('include/connect.php'); 
if(isset($_GET['id']))
{
$qry = "SELECT * FROM tbl_emp where id=".$_GET['id'];
    $result = mysql_query($qry,$conn);
	while($row = mysql_fetch_array($result));
	{
	
    if($_SERVER["REQUEST_METHOD"] == "POST")
    {
        $name = $_POST["name"];
         $age = $_POST["age"];
       $gender=$_POST['gender'];
         $martial = $_POST["martial"];
         $contact = $_POST["contact"];
         $email = $_POST["email"];
          $location= $_POST["location"];
               $category= $_POST["category"];
               
        IF($_FILES['file']['name']!='')
        {
				 $file='uploads/'.$row['image'];
				 @unlink($file);
           	     $tmp_name = $_FILES["file"]["tmp_name"];
            	 $namefile = $_FILES["file"]["name"];
				 $ext = end(explode(".", $namefile));
				 $image_name=time().".".$ext;
            	 $fileUpload = move_uploaded_file($tmp_name,"uploads/".$image_name);
		}
		else
		{
				$image_name=$row['image'];
		}
		
 	 	 $sqlAdd ="update tbl_emp set name='".$name."', age='".$age."', gender='".$gender."', martial='".$martial."', contact='".$contact."', email='".$email."', location='".$location."', category='".$category."', image='".$image_name."'  where id=".$_GET['id'];
	  	 mysql_query($sqlAdd);
         header("Location:add.php?id=".@$_GET['id']."&msg=success");
		 exit;
    }	}	
}
else
{
    if($_SERVER["REQUEST_METHOD"] == "POST")
    {
        $name = $_POST["name"];
       $age = $_POST["age"];
       $gender=$_POST['gender'];
        $martial = $_POST["martial"];
        $contact = $_POST["contact"];
         $email = $_POST["email"];
          $location= $_POST["location"];
               $category= $_POST["category"];
              
        IF($_FILES['file']['name']!='')
        {
            $tmp_name = $_FILES["file"]["tmp_name"];
            $namefile = $_FILES["file"]["name"];
			$ext = end(explode(".", $namefile));
			$image_name=time().".".$ext;

            $fileUpload = move_uploaded_file($tmp_name,"uploads/".$image_name);
        }
        $sqlAdd = mysql_query("insert into tbl_emp(name,age,gender,martial,contact,email,location,category,image) VALUES('$name','$age','$gender','$martial','$contact','$email','$location','$category','$image_name')");
        header("Location:index.php?msg=success");
		exit;
    }
}
    ob_end_flush();
	
	if(isset($_GET['msg']))
	{
	?>
    <div style="color:red;padding-bottom:10px;" class="form-message" align="center"><b>Task completd successfully.</b></div>
    <?php	
	
	}
?>


<form  method="post" name="login" id="login" enctype="multipart/form-data">
 <table class="table" width="100%">
    <tr>
    <td width="10%">Customer Details</td>
    <td></td>
  </tr>
    <tr>
    <td width="10%">Full Name</td>
    <td><input name="name" type="text" placeholder="Firstname Lastname" pattern="[A-Za-z-0-9]+\s[A-Za-z-'0-9]+" required value="<?php echo @$row['name'];?>"></td>
  </tr>
 <tr>
    <td width="20%">Age</td>
    <td><input name="age" type="text" value="<?php echo @$row['2'];?>" ></td>
  </tr>
   <tr>
   <td>Gender</td>
 <td><input type="Radio" name="gender" value="male" <?php if ($gender=='male') { echo 'checked'; } ?> />
 Male
 <input type="Radio" name="gender" value="female" <?php if ($gender=='female') { echo 'checked'; } ?> />
 Female</td>
 </tr>
  <tr>
    <td width="10%">Martial Status</td>
    <td><input name="martial" type="text" value="<?php echo @$row['4'];?>" ></td>
  </tr>
  <tr>
    <td width="20%">Contact Number</td>
    <td><input name="contact" type="text" value="<?php echo @$row['5'];?>"></td>
  </tr>
   <tr>
    <td width="10%">Email Address</td>
    <td><input name="email" type="text" value="<?php echo @$row['6'];?>"></td>
  </tr>
  <tr>
    <td width="10%">Location</td>
    <td><input name="location" type="text" value="<?php echo @$row['7'];?>" ></td>
  </tr>
   
   <tr>
    <td width="10%">category</td>
    <td>
    <select name="category" id="category" value="<?php echo @$row['11'];?>">
    <option <?php if ($category== '1' ) echo 'selected="selected'; ?> value="1">1</option>
    <option <?php if ($category== '2' ) echo 'selected="selected'; ?> value="2">2</option>
    <option <?php if ($category== '3' ) echo 'selected="selected'; ?> value="3">3</option>
  </select>
    </td>
  </tr>
 
  <tr>
    <td width="10%">Image</td>
    <td><input name="file" type="file" multiple="" ></td>
    
  </tr>
   <?php
   if(isset($row['image'])) 
   {
   ?>
   <tr>
        <td>&nbsp;</td>
        <td><img src="uploads/<?php echo $row['image'];?> " height="50" width="50"></td>
   </tr>
	<?php
	}
	?>
  <tr>
    <td>&nbsp;</td>
    <td>
    <input name="submit" value="Submit" type="submit" class="submit">
    <input name="submit" value="Cancel" type="button" class="submit" onClick="window.location='index.php'">
    </td>
  </tr>
</table>
</form> 
<a href="http://dme-medical.com/library/search.php">Go back to list</a>       
    </div>
    </div>
</div>
</div>
</article></div>
                    </div>
                </div>
            </div>
    </div>
<footer class="art-footer clearfix">
  <div class="art-footer-inner">
<p>Copyright © 2016. All Rights Reserved.</p>
    <p class="art-page-footer">
      
    </p>
  </div>
</footer>

</div>


</body></html>
<!-------------------------new code end ----------------------------->


<!-- begin snippet: js hide: false -->

    my edit.php code 
    <!DOCTYPE html>
    <html dir="ltr" lang="en-US"><head><!-- Created by Artisteer v4.0.0.58475 -->
        <meta charset="utf-8">
        <title>library</title>
        <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">
        <link href='https://sites.google.com/site/99webdemos/favicon.png' rel='shortcut icon' type='image/x-icon'/>
        <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
        <link rel="stylesheet" href="css/style.css" media="screen">
        <!--[if lte IE 7]><link rel="stylesheet" href="style.ie7.css" media="screen" /><![endif]-->
        <link rel="stylesheet" href="css/style.responsive.css" media="all">


        <script src="js/jquery.js"></script>
        <script src="js/script.js"></script>
        <script src="js/script.responsive.js"></script>
        <script type="text/javascript" language="JavaScript">
        jQuery(document).ready(function()
        {
          jQuery(".form-message").fadeOut(10000);
        });
        </script>
       

    <style>.art-content .art-postcontent-0 .layout-item-0 { padding-right: 10px;padding-left: 10px;  }
    .ie7 .post .layout-cell {border:none !important; padding:0 !important; }
    .ie6 .post .layout-cell {border:none !important; padding:0 !important; }

    </style></head>
    <body>
    <div id="art-main">
        <div id="art-header-bg" class="clearfix">
                </div>
        <div id="art-hmenu-bg" class="art-bar art-nav clearfix">
        </div>
        <div class="art-sheet clearfix">
    <header class="art-header clearfix">


        <div class="art-shapes">
    <h1 class="art-headline" data-left="0.5%">
        <a  href="http://www.99demos.blogspot.com" target="_blank">library</a>
    </h1>
    <h2 class="art-slogan" data-left="87.05%"><a href="http://99demos.blogspot.in/2014/06/createreadupdate-delete-with-image.html"></a></h2>


                </div>

    <nav class="art-nav clearfix">
        <div class="art-nav-inner">
        <ul class="art-hmenu"><li><a href="index.php" class="active">Home</a></li></ul> 
            </div>
        </nav>

                        
    </header>
    <div class="art-layout-wrapper clearfix">
                    <div class="art-content-layout">
                        <div class="art-content-layout-row">
                            <div class="art-layout-cell art-content clearfix"><article class="art-post art-article">
                                    <h2 class="art-postheader">customer form</h2>
                                                    
                    <div class="art-postcontent art-postcontent-0 clearfix"><div class="art-content-layout">
        <div class="art-content-layout-row">
        <div class="art-layout-cell layout-item-0" style="width: 100%" >
            <br>
            
            
    <?php
    ob_start(); 
    include('include/connect.php'); 
    if(isset($_GET['id']))
    {

    	$qry = "SELECT * FROM tbl_emp where id=".$_GET['id'];
        $result = mysql_query($qry);
    	$row = mysql_fetch_array($result);
    	
        if($_SERVER["REQUEST_METHOD"] == "POST")
        {
            $name = $_POST["name"];
             $age = $_POST["age"];`enter code here`
             $gender = $_POST["gender"];
             $martial = $_POST["martial"];
             $contact = $_POST["contact"];
             $email = $_POST["email"];
              $location= $_POST["location"];
                              $category= $_POST["category"];
                  
            IF($_FILES['file']['name']!='')
            {
    				 $file='uploads/'.$row['image'];
    				 @unlink($file);
               	     $tmp_name = $_FILES["file"]["tmp_name"];
                	 $namefile = $_FILES["file"]["name"];
    				 $ext = end(explode(".", $namefile));
    				 $image_name=time().".".$ext;
                	 $fileUpload = move_uploaded_file($tmp_name,"uploads/".$image_name);
    		}
    		else
    		{
    				$image_name=$row['image'];
    		}
    		
     	 	 $sqlAdd ="update tbl_emp set name='".$name."', age='".$age."', gender='".$gender."', martial='".$martial."', contact='".$contact."', email='".$email."', location='".$location."', category='".$category."', image='".$image_name."'  where id=".$_GET['id'];
    	  	 mysql_query($sqlAdd);
             header("Location:add.php?id=".@$_GET['id']."&msg=success");
    		 exit;
        }		
    }
    else
    {
        if($_SERVER["REQUEST_METHOD"] == "POST")
        {
            $name = $_POST["name"];
           $age = $_POST["age"];
           $gender = $_POST["gender"];
            $martial = $_POST["martial"];
            $contact = $_POST["contact"];
             $email = $_POST["email"];
              $location= $_POST["location"];
                             $category= $_POST["category"];
                   
            IF($_FILES['file']['name']!='')
            {
                $tmp_name = $_FILES["file"]["tmp_name"];
                $namefile = $_FILES["file"]["name"];
    			$ext = end(explode(".", $namefile));
    			$image_name=time().".".$ext;

                $fileUpload = move_uploaded_file($tmp_name,"uploads/".$image_name);
            }
            $sqlAdd = mysql_query("insert into tbl_emp(name,age,gender,martial,contact,email,location,category,image) VALUES('$name','$age','$gender','$martial','$contact','$email','$location','$category','$image_name')");
            header("Location:index.php?msg=success");
    		exit;
        }
    }
        ob_end_flush();
    	
    	if(isset($_GET['msg']))
    	{
    	?>
        <div style="color:red;padding-bottom:10px;" class="form-message" align="center"><b>Task completd successfully.</b></div>
        <?php	
    	}
    ?>


    <form  method="post" name="login" id="login" enctype="multipart/form-data">
     <table class="table" width="100%">
        <tr>
        <td width="10%">Customer Details</td>
        <td></td>
      </tr>
        <tr>
        <td width="10%">Full Name</td>
        <td><input name="name" type="text" placeholder="Firstname Lastname" pattern="[A-Za-z-0-9]+\s[A-Za-z-'0-9]+" required value="<?php echo @$row['name'];?>"></td>
      </tr>
     <tr>
        <td width="20%">Age</td>
        <td><input name="age" type="text" value="<?php echo @$row['2'];?>" ></td>
      </tr>
       <tr>
       <td>Gender</td>
     <td><input type="radio" name="gender" value="male" <?php if($result['gender']=="male"){ echo "checked";}?> >
     Male
     <input type="radio" name="gender" value="female" <?php if($result['gender']=="female"){ echo "checked";}?>>
     Female</td>
     </tr>
      <tr>
        <td width="10%">Martial Status</td>
        <td><input name="martial" type="text" value="<?php echo @$row['4'];?>" ></td>
      </tr>
      <tr>
        <td width="20%">Contact Number</td>
        <td><input name="contact" type="text" value="<?php echo @$row['5'];?>"></td>
      </tr>
       <tr>
        <td width="10%">Email Address</td>
        <td><input name="email" type="text" value="<?php echo @$row['6'];?>"></td>
      </tr>
      <tr>
        <td width="10%">Location</td>
        <td><input name="location" type="text" value="<?php echo @$row['7'];?>" ></td>
      </tr>
      
       <tr>
        <td width="10%">category</td>
        <td>
       <select name="category" id="category" value="<?php echo @$row['11'];?>">
        <option <?php if ($selected == 'select' ) echo 'selected'; ?> value="select">select</option>
        <option <?php if ($selected == '1' ) echo 'selected'; ?> value="1">1</option>
        <option <?php if ($selected == '2' ) echo 'selected'; ?> value="2">2</option>
        <option <?php if ($selected == '3' ) echo 'selected'; ?> value="3">3</option>
      </select>
        </td>
      </tr>
     
      <tr>
        <td width="10%"> Image</td>
        <td><input name="file" type="file" multiple="" ></td>
        
      </tr>
       <?php
       if(isset($row['image'])) 
       {
       ?>
       <tr>
            <td>&nbsp;</td>
            <td><img src="uploads/<?php echo $row['image'];?> " height="50" width="50"></td>
       </tr>
    	<?php
    	}
    	?>
      <tr>
        <td>&nbsp;</td>
        <td>
        <input name="submit" value="Submit" type="submit" class="submit">
        <input name="submit" value="Cancel" type="button" class="submit" onClick="window.location='index.php'">
        </td>
      </tr>
    </table>
    </form> 
    <a href="http://dme-medical.com/library/search.php">Go back to list</a>       
        </div>
        </div>
    </div>
    </div>
    </article></div>
                        </div>
                    </div>
                </div>
        </div>
    <footer class="art-footer clearfix">
      <div class="art-footer-inner">
    <p>Copyright © 2016. All Rights Reserved.</p>
        <p class="art-page-footer">
          
        </p>
      </div>
    </footer>

    </div>


    </body></html>