Page MenuHomec4science

just_a_check.php
No OneTemporary

File Metadata

Created
Fri, May 9, 05:43

just_a_check.php

<?php
//$conn = pg_connect("host=localhost port=5432 dbname=i2b2 user=postgres password=admin");
$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;
}
$query =
"SELECT variant_annotations
FROM shrine_ont.genomic_annotations
WHERE variant_id = -8935125523235860480";
$result = pg_query($conn, $query);
if (!$result) {
echo "An error occurred.\n";
exit;
}
// In json format return the list of genes
$geneList = "";
while ($row = pg_fetch_row($result)) {
$geneList .= "\"$row[0]\",";
}
// drop the last comma and concatenate in json format
echo "[" . substr($geneList, 0, -1) . "]";

Event Timeline