-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudentdb.php
More file actions
55 lines (43 loc) · 969 Bytes
/
studentdb.php
File metadata and controls
55 lines (43 loc) · 969 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
45
46
47
48
49
50
51
52
53
54
<html>
<?php
$host="localhost";
$username="root";
$password="saibaba";
$db_name="student";
$tbl_name="student";
$conn= mysqli_connect("$host","$username","$password","$db_name")or die("Cannot connect");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$orderid=$_POST['orderid'];
$from=$_POST['from'];
$rollno=$_POST['rollno'];
$phnno=$_POST['phoneno'];
$rackno=$_POST['rack'];
$sqli="INSERT INTO student VALUES ('$orderid','$from','$rollno','$phnno','$rackno')";
$result=mysqli_query($conn,$sqli);
echo "The order id is $orderid";
echo "<br>";
echo "The website is $from";
echo "<br>";
echo "The roll no. is $rollno";
echo "<br>";
echo "The phone no. is $phnno";
echo "<br>";
echo "The rack no. is $rackno";
echo "<br>";
$count=mysqli_num_rows($result);
$value="Succesful!!";
if($count==1)
{
echo "<h1>Successful!</h1>";
echo "<br>";
echo "<br>";
echo "<br>";
}
else
{
echo "<h1>Succesful!!!!</h1>";
}
?>