When a column alias was used like below to get data from PostgreSQL, the PHP code doesn't run. However, when I don't use column alias, then the PHP code works so I know that my PHP code is correct. Is there a way to make column alias works from PostgreSQL and within PHP framework?
$SQL1 = "
SELECT count(distinct emcas_gbo_gs.w_customer_d.cust_id) as "CNT"
FROM emcas_gbo_gs.w_customer_d
";
$dataQuery1 = pg_query($mycon, $SQL1) or die('Query failed: ' . pg_last_error());
$dataCnt1 = pg_fetch_result($dataQuery1,0,'CNT');