Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110247689
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
Fri, Apr 25, 08:46
Size
635 B
Mime Type
text/x-php
Expires
Sun, Apr 27, 08:46 (1 d, 12 h)
Engine
blob
Format
Raw Data
Handle
25799478
Attached To
R4897 i2b2-webclient
getAnnotations.php
View Options
<?php
//echo "Connecting ... <br>";
$conn
=
pg_connect
(
"host=localhost port=5432 dbname=i2b2 user=postgres password=admin"
);
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