-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-ajax.php
More file actions
43 lines (31 loc) · 962 Bytes
/
test-ajax.php
File metadata and controls
43 lines (31 loc) · 962 Bytes
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
<?php
$search_value= $_POST["search"];
$conn=mysqli_connect("localhost",'root', '','crud') or die ("Connection Failed");
$sql="SELECT * FROM data_base WHERE name LIKE '%{$search_value}%' OR Email LIKE '%{$search_value}%'";
$result= mysqli_query($conn,$sql) or die ("sql Query failed");
$output="";
if(mysqli_num_rows($result) >0 ){
$output = "<table>
<tr>
<th>Sr</th>
<th>Name</th>
<th>Email</th>
<th>Password</th>
<th>Image</th>
</tr>";
while($row= mysqli_fetch_assoc($result)){
$output.="<tr>
<td>{$row['id']}</td>
<td>{$row['name']}</td>
<td>{$row['email']}</td>
<td>{$row['password']}</td>
<td><img src='images/{$row['image']}' width='15%' ></td>
</tr>";
}
$output.="</table>";
mysqli_close($conn);
echo $output;
}else{
echo "<h2>No record Found</h2>";
}
?>