0% found this document useful (0 votes)
12 views

My Code

Uploaded by

syedshahbaxali05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

My Code

Uploaded by

syedshahbaxali05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<?php include 'header.

php';
?>

<div id="main-content">
<h2>Update Record</h2>

<?php
include('dbconnection.php');
$id = $_GET['id'];
$sql = "SELECT * FROM 2312f1table where id = '{$id}'";
$result = mysqli_query($con, $sql);
if(mysqli_num_rows($result) > 0){

while($row = mysqli_fetch_assoc($result)){

?>
<form class="post-form" action="updatedata.php" method="post">
<div class="form-group">
<label>Name</label>
<input type="hidden" name="id" value="<?php echo $row['id']; ?>"/>
<input type="text" name="name" value="<?php echo $row['name']; ?>"/>
</div>
<div class="form-group">
<label>Address</label>
<input type="text" name="address" value="<?php echo $row['address']; ?
>"/>
</div>
<div class="form-group">
<label>Designation</label>
<select name="designation">
<option value="" selected disabled>Select Designation</option>
<?php
$sql1 = "SELECT DISTINCT (designation) FROM 2312f1table";
$result1 = mysqli_query($con, $sql1);
if(mysqli_num_rows($result1) > 0){
while($row1 = mysqli_fetch_assoc($result1)){
echo "<option value =
'{$row1['designation']}'>{$row1['designation']}'</option> ";
}
}
?>
<option value="Full Stack Developer">Full Stack Developer</option>
<option value="UI/UX Designer">UI/UX Designer</option>
<option value="Graphic Designer">Graphic Designer</option>
</select>
</div>
<div class="form-group">
<label>Phone</label>
<input type="text" name="phone" value="<?php echo $row['phone']; ?>"/>
</div>
<input class="submit" type="submit" value="Update"/>
</form>
<?php
}
}
?>
</div>
</div>
</body>
</html>

You might also like