-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_studies.php
More file actions
30 lines (25 loc) · 893 Bytes
/
get_studies.php
File metadata and controls
30 lines (25 loc) · 893 Bytes
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
<?php
include('db.php');
$key = urldecode($_GET['key']);
// echo $key."<br/>";
$conn = connect();
$studyAttributes = array(
"StudyID"=>"Study ID",
"DiseaseCategory"=>"Disease category",
"DiseaseName"=>"Disease name",
"Sample"=>"Sample",
"FoldChangeSubjects"=>"Log<sub>2</sub> Fold Change Subjects",
"ConditionState"=>"Condition/State",
"GEOAccession"=>"GEO Accession",
);
$studyQuery = "select ".implode(",", array_keys($studyAttributes))." from study_metadata where DiseaseCategory=?;";
// echo $studyQuery."<br/>";
$studyStmt = $conn->prepare($studyQuery);
$studyStmt->bind_param("s", $key);
$studyStmt->execute();
$studyRows = execute_and_fetch_assoc($studyStmt);
$studyStmt->close();
closeConnection($conn);
$rowsJSON = json_encode($studyRows);
echo $rowsJSON;
?>