-
Notifications
You must be signed in to change notification settings - Fork 1
/
transcripts.php
66 lines (49 loc) · 1.2 KB
/
transcripts.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "genes";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
?>
<ul id="menu">
<li><a href="#">Home</a></li>
<li><a href="index.php">Search</a></li>
<li><a href="add.php">Upload</a></li>
<li><a href="#">Download</a></li>
<li><a href="#">Contact</a></li>
</ul>
<br /><br />
<?php
$transcript_id = $_GET['transcript_id'];
$query = "select * from sequences where transcript_id like '$transcript_id'";
$result = mysqli_query($conn, $query);
while($row = mysqli_fetch_assoc($result))
{
$sequence = $row["sequence"];
print "<pre style = 'margin-left: 1cm; background-color: lightgrey; padding: 10px; width: 800px'>";
print ">$transcript_id<br />";
for($i = 0; $i < strlen($sequence); $i++)
{
$nt = $sequence[$i];
if($i%100 == 0 && $i > 0)
{
print "<br />";
}
print $nt;
}
print "</pre>";
}
?>
</body>
</html>