Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F75316914
getAnnotations.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 1, 14:23
Size
640 B
Mime Type
text/x-php
Expires
Sat, Aug 3, 14:23 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19468460
Attached To
R2664 SHRINE MedCo Fork
getAnnotations.php
View Options
<?php
//echo "Connecting ... <br>";
$conn
=
pg_connect
(
"host=localhost port=5432 dbname=i2b2 user=shrine_ont password=demouser"
);
if
(!
$conn
)
{
echo
"Error while connecting to the postgres database"
;
exit
;
}
// just get the first row (which already contain all the annotations' name)
$result
=
pg_query
(
$conn
,
"SELECT annotation_id FROM shrine_ont.genomic_annotations_metadata"
);
if
(!
$result
)
{
echo
"An error occurred.
\n
"
;
exit
;
}
// json format
$annotationNames
=
"["
;
while
(
$row
=
pg_fetch_row
(
$result
))
{
$annotationNames
.=
"
\"
$row[0]
\"
,"
;
}
// drop the last comma
echo
substr
(
$annotationNames
,
0
,
-
1
)
.
"]"
;
Event Timeline
Log In to Comment