-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavContact.php
45 lines (29 loc) · 848 Bytes
/
navContact.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
<?php
$host = "localhost";
$user = "first_year";
$database = "first_year";
$passwd = "first_year";
$con = new mysqli($host, $user, $passwd, $database);
if($con->connect_errno) {
die("Can not connect: ".$con->connect_error);
}
$user_table = "mihir_users";
$contactId = $_POST['contactId'];
$sql = "SELECT username, image FROM $user_table WHERE id = $contactId";
$result = $con->query($sql);
if($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo(
"<div class='contact-image'>".
'<img class="navContactImage" src="data:image;base64,'.$row['image'].'">'.
"</div>".
"<div class='contact-name'>".
$row['username'].
"</div>".
"<div class='contact-status'>".
"</div>"
);
}
}
mysqli_close($con);
?>