Commit 8ee6d1ec authored by Ajayguru Madu's avatar Ajayguru Madu
Browse files

Upload New File

parent fc1748bf
<?php
require('db.php');
include("auth.php");
$id=$_REQUEST['id'];
$query = "SELECT * from bloo where id='".$id."'";
$result = mysqli_query($con, $query) or die ( mysqli_error());
$row = mysqli_fetch_assoc($result);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Update Record</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="form">
<p><a href="dashboard.php">Dashboard</a> | <a href="insert.php">Insert New Record</a> | <a href="logout.php">Logout</a></p>
<h1>Update Record</h1>
<?php
$status = "";
if(isset($_POST['new']) && $_POST['new']==1)
{
$id=$_REQUEST['id'];
$uname =$_REQUEST['uname'];
$blood=$_REQUEST['blood'];
$age =$_REQUEST['age'];
$addr1 =$_REQUEST['addr1'];
$mobile=$_REQUEST['mobile'];
$city=$_REQUEST['city'];
$update="update bloo set uname='".$uname."', blood='".$blood."', age='".$age."', addr1='".$addr1."',mobile='".$mobile."',city='".$city."' where id='".$id."'";
$result1= mysqli_query($con, $update) or die ( mysqli_error());
$status = "Record Updated Successfully. </br></br><a href='view.php'>View Updated Record</a>";
echo '<p style="color:#FF0000;">'.$status.'</p>';
}else {
?>
<div>
<form name="form" method="post" action="">
<input type="hidden" name="new" value="1" />
<input name="id" type="hidden" value="<?php echo $row['id'];?>" />
<p><input type="text" name="uname" placeholder="Enter Name" required value="<?php echo $row['uname'];?>" /></p>
<p><input type="text" name="blood" placeholder="Enter BLood Group" required value="<?php echo $row['blood'];?>" /></p>
<p><input type="text" name="age" placeholder="Enter Age" required value="<?php echo $row['age'];?>" /></p>
<p><input type="text" name="addr1" placeholder="Enter Address" required value="<?php echo $row['addr1'];?>" /></p>
<p><input type="text" name="mobile" placeholder="Enter Mobile No" required value="<?php echo $row['mobile'];?>" /></p>
<p><input type="text" name="city" placeholder="Enter City" required value="<?php echo $row['city'];?>" /></p>
<p><input name="submit" type="submit" value="Update" /></p>
</form>
<?php } ?>
</div>
</div>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment