-
Notifications
You must be signed in to change notification settings - Fork 0
/
freinds.html
51 lines (47 loc) · 1.22 KB
/
freinds.html
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
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<form action="addf.php" method="post">
<br><br>
<div class="form-group">
<div class="col-xs-6">
<input type="text" class="form-control" id="usr" placeholder="Enter username or Mobile number" name="username">
</div><button type="submit" class="btn btn-primary" name="submit">Primary</button>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST["submit"]))
{
$user=$_POST["username"];
$con=mysqli_connect("localhost","root","karthik","chatting");
$query="select freind from feinds where username='123' ";
$res=mysqli_query($con,$query);
if($res)
{
$i=0;
$number=mysqli_num_rows($res);
if($number>0)
{
while ($row=mysqli_fetch_assoc($res))
{
$messages[$i]=$row["freind"];
$i++;
}
while ($i>0)
{
$i--;
echo $messages[$i]."<p>";
}
}
}
}
?>