-
Notifications
You must be signed in to change notification settings - Fork 0
/
search_user_name.php
48 lines (40 loc) · 1.2 KB
/
search_user_name.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
<style>
#user_name_data li a {
color: black !important;
transition: all 0.2s 0s ease-out;
text-decoration: none !important;
text-decoration-color: rgb(16, 206, 32);
display: block;
padding: .75rem 1.25rem;
}
#user_name_data li a:hover {
color: #0073aa !important;
}
/* #user_name_data li a:hover {
color: #0073aa !important;
} */
</style>
<?php
include 'connect_db.php';
$database=new database();
$db = $database->connect_mysqli();
if (isset($_GET['q'])) {
$serval=$_GET['q'];
$serval="%$serval%";
$query1="select * from users where status=? and name like ? limit 0,5";
$stmt1 = $db->prepare($query1);
if ($stmt1) {
$status_val = '1';
$stmt1->bind_param('ss', $status_val, $serval);
$stmt1->execute();
$result = $stmt1->get_result();
if($result->num_rows > 0)
{
while($row=$result->fetch_array(MYSQLI_ASSOC)){
echo '<li class="list-group-item p-0"><a href="javascript:;" data-id="'.$row['id'].'">'.$row['name'].'</a></li>';
}
exit();
}
}
}
?>