-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path60.php
More file actions
44 lines (36 loc) · 850 Bytes
/
60.php
File metadata and controls
44 lines (36 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
$db_host="localhost";
$db_user="root";
$db_password="";
$db_name="test_db";
$con=new mysqli($db_host,$db_user,$db_password,$db_name);
if($con->connect_error)
{
die("Connection Failed");
}
echo "Connected Successfully";
if(isset($_REQUEST['edit']))
{
if(($_REQUEST['id'])==""||($_REQUEST['name']=="")||($_REQUEST['roll']=="")||($_REQUEST['address']==""))
{echo "Fill All The Field";}
else
{
$sql="UPDATE student SET id=?,name=?,roll=?,address=? WHERE id=? ";
$result=$con->prepare($sql);
if($result)
{
$result->bind_param('sis',$id,$name,$roll,$address);
$id=$_REQUEST['id'];
$name=$_REQUEST['name'];
$roll=$_REQUEST['roll'];
$address=$_REQUEST['address'];
$result->execute();
$result->affected_rows();
$result->close();
}
}
}
set in the FROM
<input type="text" value='.$id.'>
value= "<?php if(isset($address)){echo $address} ?>">
?>