-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.php
53 lines (51 loc) · 1.47 KB
/
Index.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
<?php
$con=mysqli_connect("127.0.0.1","root","","keerthana");
// if(isset($_POST["name"]) && !empty($_POST["name"])){
// $name=$_POST["name"];
// $phone=$_POST["phone"];
// $password=$_POST["password"];
// $sql="INSERT INTO users(`name`,`phone`,`password`) VALUES('$name','$phone','$password')";
// mysqli_query($con,$sql);
// }
$row=mysqli_query($con,"SELECT * FROM users");
// while($single=mysqli_fetch_assoc($row)){
// // echo $single["name"].$single["phone"];
// }
?>
<html>
<head>
<style>
table,td,th{
border:1px solid black;
border-collapse:collapse;
}
th,td{
padding:10px 20px;
}
</style>
</head>
<body>
<form action="Client.php" method="post">
<input type="text" name="name">
<input type="text" name="phone">
<input type="password" name="password">
<input type="submit" value="submit">
</form>
<table>
<tr>
<th>SN</th>
<th>name</th>
<th>phone number</th>
</tr>
<?php
$sn=0;
while($single=mysqli_fetch_assoc($row)){ ?>
<tr>
<td><?php echo ++$sn;?></td>
<td><?php echo $single["name"];?></td>
<td><?php echo $single["phone"];?></td>
</tr>
<?php }?>
</table>
</body>
</html>