-
Notifications
You must be signed in to change notification settings - Fork 0
/
student4.php
80 lines (59 loc) · 1.32 KB
/
student4.php
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<html>
<head>
<title>CIS</title>
<style>
table,th,td {
border:1px solid black;
background-color: #FF9900;
}
</style>
</head>
<body>
<!--insert data-->
<?php
$host="localhost";
$uname="root";
$pwd="";
$dbname="student";
$conn=mysqli_connect($host,$uname,$pwd,$dbname);
if($conn){
echo "successfully connected";
echo "<br>";
echo "<br>";
}
else
{
echo "Error";
}
if(!empty($_POST['submit'])){
$s="INSERT INTO cis_student_4(reg_no,ep_no,first_name,last_name,address,contact_no)
VALUES('$_POST[reg_no]','$_POST[e_no]','$_POST[f_name]','$_POST[l_name]','$_POST[add]','$_POST[con]')";
mysqli_query($conn,$s);
}
/*
$sel="select * from cis_student_4";
$search=$conn->query($sel);
if($search->num_rows>0){
echo "<table><tr>
<th>Reg_no</th>
<th>EP_no</th>
<th>First_name</th>
<th>Last_name</th>
<th>Address</th>
<th>Contacat</th>
</tr>";
while($row=$search->fetch_assoc()){
echo "<tr><td>".$row["reg_no"]."</td>
<td>".$row["ep_no"]."</td>
<td>".$row["first_name"]."</td>
<td>".$row["last_name"]."</td>
<td>".$row["address"]."</td>
<td>".$row["contact"]."</td></tr>";
}
echo "</table>";
}
*/
header('Location:4_cis_m1.php');
?>
</body>
</html>