Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81771812
getAnnotationValues.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
Sat, Sep 7, 20:51
Size
790 B
Mime Type
text/x-php
Expires
Mon, Sep 9, 20:51 (2 d)
Engine
blob
Format
Raw Data
Handle
20617605
Attached To
R2664 SHRINE MedCo Fork
getAnnotationValues.php
View Options
<?php
// case insensitive with regex
//select annotation_value
//from <annotation_name>
//where annotation_value ~* '.*a1.*'
//LIMIT 20
include
'sqlConnection.php'
;
// get the row which contains all the values of the passed annotation
$query
=
"SELECT annotation_value
FROM "
.
$_GET
[
"annotation_name"
]
.
"
WHERE annotation_value ~* '.*"
.
$_GET
[
"annotation_value"
]
.
".*'
LIMIT "
.
$_GET
[
"limit"
];
$result
=
pg_query
(
$conn
,
$query
);
if
(!
$result
)
{
echo
"An error occurred while querying the database.
\n
"
;
exit
;
}
// In json format return the list of annotation names
$annotationList
=
""
;
while
(
$row
=
pg_fetch_row
(
$result
))
{
$annotationList
.=
"
\"
$row[0]
\"
,"
;
}
// drop the last comma and concatenate in json format
echo
"["
.
substr
(
$annotationList
,
0
,
-
1
)
.
"]"
;
Event Timeline
Log In to Comment