-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOtherRNA.php
77 lines (69 loc) · 2.37 KB
/
OtherRNA.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function change(id) {
var url = "info_detail.php?id=" + id;
//document.location.href=url;
window.open(url);
}
</script>
</head>
<body>
<?php
$con = mysqli_connect('ip','user','passwd', 'database');
if (!$con) {
die("Fail to connect MySQL: " . mysqli_connect_errno());
}
mysqli_set_charset($con, 'utf8mb4');
$query = 'SELECT
ID, Biomarker, Location, Application, Reference_first_author, Reference_journal, Reference_year
FROM
biomarker
WHERE Category LIKE "%RNA%" AND Category NOT LIKE "%miRNA%" AND Category NOT LIKE "%lncRNA%" AND Category NOT LIKE "%circRNA%"
ORDER BY
ID ASC';
$result = mysqli_query($con, $query);
// determine number of rows in returned result
$biomarker = mysqli_num_rows($result);
if ($biomarker == 0) {
header("Location: you.html");
} else { ?>
<div style="text-align: center;">
<h2>OtherRNA biomarker list</h2>
<p style="text-align: center;"><?php echo $biomarker; ?> biomarkers</p>
<table class="tab">
<thead>
<tr>
<th>ID</th>
<th>Biomarker</th>
<th>Location</th>
<th>Application</th>
<th>Reference</th>
</tr>
</thead>
<tbody>
<?php
// loop through the results
while ($row = mysqli_fetch_assoc($result)) {
extract($row); ?>
<tr onclick="change(this.id)" style="cursor:pointer;" id='<?php echo $ID ?>'>
<?php
echo '<td>' . $ID . '</td>';
echo '<td>' . $Biomarker . '</td>';
echo '<td>' . $Location . '</td>';
echo '<td>' . $Application . '</td>';
echo '<td>' . $Reference_first_author . '. ' . $Reference_journal . '. ' . $Reference_year . '</td>';
?>
</tr> <?php
} ?>
</tbody>
</table>
</div>
<?php
}?>
</body>
</html>