-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch-unigene-result.php
65 lines (63 loc) · 1.91 KB
/
search-unigene-result.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
<?php
require("connect.inc.php");
@$unigeneid=$_POST["unigeneid"];
if(empty($unigeneid)) die("Input a valid Unigene id.");
$sql='SELECT * from `table5` WHERE `SeqID` = "'.$unigeneid.'"';
//ADD ALL FIELD NAMES HERE
//colnames to fetch
$colNames=array("SeqId","unigeneseq");
//colnames to displays
$displayColNames=array("Sequence Id", "Sequence");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Search result</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="http://getbootstrap.com.vn/examples/equal-height-columns/equal-height-columns.css" />
<link rel="stylesheet" type="text/css" href="resources/css/custom-home.css">
<link rel="stylesheet" type="text/css" href="">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<?php include("navbar.inc.php") ?>
<!-- page body container-->
<div class="container">
<table class=" table table-hover table-responsive">
<thead>
<tr>
<?php
foreach ($displayColNames as $key) {
echo "<th>".$key."</th>";
}
?>
</tr>
</thead>
<tbody>
<?php
//fetching required data
if ( $query_run = mysql_query( $sql) ) {
while ( $query_row=mysql_fetch_assoc ( $query_run ) ) {
for($i=0;$i<sizeof($colNames);$i++){
$data[$i] = $query_row[$colNames[$i]]; //fetch data of each row in an array data
}
echo "<tr>";
foreach ($data as $key)
echo "<td>".$key."</td>";
echo "</tr>";
}
}
else {
echo mysql_error();
}
?>
</tbody>
</table>
</div>
<!-- end container -->
<hr>
</body>
</html>