I am trying to catch error mechanism with php but it does not return $dataTable on exceptions. if pg_quey gives error, it prints error message on screen.
try{
$queryResult = pg_query($this->connection, $query_string);
while($row = pg_fetch_assoc($queryResult)){
$dataTable[] = $row;
}
return $dataTable[0];
}catch (Exception $ex){
return $dataTable;
}