-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnew_qtl_pheno.php
executable file
·103 lines (91 loc) · 3.09 KB
/
new_qtl_pheno.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<html>
<body>
<?php
$initial_connect = mysql_connect("lab.bcb.iastate.edu", "yhames04", "gdcb07");
mysql_select_db("sandbox_yhames04", $initial_connect);
$sql="SELECT unit_uid, phenotypes_name FROM phenotypes";
$res = mysql_query($sql) or die(mysql_error());
while($row=mysql_fetch_assoc($res))
{
$unit_uid=$row['unit_uid'];
$phenotypes_name=$row['phenotypes_name'];
echo $phenotypes_name;
echo " ";
$sql="SELECT unit_name FROM units WHERE unit_uid=$unit_uid";
$res1=mysql_query($sql) or die(mysql_error());
$row1=mysql_fetch_assoc($res1);
$unit_name=$row1['unit_name'];
echo $unit_name;
echo " ; ";
}
echo "<br><br><br><br><br>";
$sql="SELECT tht_base_uid, value FROM phenotype_data";
$res = mysql_query($sql) or die(mysql_error());
$prev=null;
$count=0;
while($row=mysql_fetch_assoc($res))
{
$tht_base_uid=$row['tht_base_uid'];
$value=$row['value'];
if($count==0)
{
$prev=$tht_base_uid;
$sql_thtbase="SELECT line_record_uid, experiment_uid FROM tht_base WHERE tht_base_uid=$tht_base_uid";
$res_thtbase=mysql_query($sql_thtbase) or die(mysql_error());
$row_thtbase=mysql_fetch_assoc($res_thtbase);
$line_record_uid=$row_thtbase['line_record_uid'];
$experiment_uid=$row_thtbase['experiment_uid'];
$sql_linerecords="SELECT line_record_name FROM line_records WHERE line_record_uid=$line_record_uid";
$res_linerecords=mysql_query($sql_linerecords) or die(mysql_error());
$row_linerecords=mysql_fetch_assoc($res_linerecords);
$line_record_name=$row_linerecords['line_record_name'];
$sql_experiments="SELECT experiment_name FROM experiments WHERE experiment_uid=$experiment_uid";
$res_experiments=mysql_query($sql_experiments) or die(mysql_error());
$row_experiments=mysql_fetch_assoc($res_experiments);
$experiment_name=$row_experiments['experiment_name'];
echo "<br>";
echo $line_record_name;
echo " ";
echo $experiment_name;
echo " ";
echo $value;
echo " ";
}//end if
else
{
if($prev==$tht_base_uid)
{
echo "$value";
echo " ";
continue;
}
else
{
$prev=$tht_base_uid;
$sql_thtbase="SELECT line_record_uid, experiment_uid FROM tht_base WHERE tht_base_uid=$tht_base_uid";
$res_thtbase=mysql_query($sql_thtbase) or die(mysql_error());
$row_thtbase=mysql_fetch_assoc($res_thtbase);
$line_record_uid=$row_thtbase['line_record_uid'];
$experiment_uid=$row_thtbase['experiment_uid'];
$sql_linerecords="SELECT line_record_name FROM line_records WHERE line_record_uid=$line_record_uid";
$res_linerecords=mysql_query($sql_linerecords) or die(mysql_error());
$row_linerecords=mysql_fetch_assoc($res_linerecords);
$line_record_name=$row_linerecords['line_record_name'];
$sql_experiments="SELECT experiment_name FROM experiments WHERE experiment_uid=$experiment_uid";
$res_experiments=mysql_query($sql_experiments) or die(mysql_error());
$row_experiments=mysql_fetch_assoc($res_experiments);
$experiment_name=$row_experiments['experiment_name'];
echo "<br>";
echo $line_record_name;
echo " ";
echo $experiment_name;
echo " ";
echo $value;
echo " ";
}//end else
}//end else
$count++;
}
?>
</body>
</html>