-
Notifications
You must be signed in to change notification settings - Fork 0
/
search for a word.php
55 lines (39 loc) · 1.31 KB
/
search for a word.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
54
55
<head>
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#accordion" ).accordion();
} );
</script>
<style>
{
font-family:Arial,Helvetica,sans-serrif;
}
</style>
</head>
<?php
include "db_connect.php";
$keywordfromforum =$_GET["keyword"];
//echo $keywordfromforum;
// search for a word
echo "<h1>Show all sequences which are ".$keywordfromforum." : </h1>";
$sql = "SELECT identifier,Biomaterial_type,Sequences,Source FROM Biologicaldata WHERE Biomaterial_type LIKE '%".$keywordfromforum."%'";
$result = $mysqli->query($sql);
?>
<div id="accordion">
<?php
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
//echo "id: " . $row["identifier"]. " - Biomaterial type: " . $row["Biomaterial_type"]. " - Sequence: " . $row["Sequences"]. " - Source: " . $row["Source"]. "<br>";
echo"<h3>$row[identifier]</h3>";
echo"<div><p> $row[Biomaterial_type] <br> $row[Source] <br> $row[Sequences] </p></div>";
}
} else {
echo "0 results";
}
?>
</div>