-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path58.php
More file actions
38 lines (33 loc) · 732 Bytes
/
58.php
File metadata and controls
38 lines (33 loc) · 732 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
<?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['submit']))
{
if(($_REQUEST['id'])==""||($_REQUEST['name']=="")||($_REQUEST['roll']=="")||($_REQUEST['address']==""))
{echo "Fill All The Field";}
else
{
$sql="INSERT INTO student (id,name,roll,address)VALUES(?,?,?,?)";
$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->close();
$con->close();
}
}
}
?>