So, AFAIK, there are two ways to test whether a result set is populated. Starting with $res = pg_query($select); the two options I\'ve used are pg_num_rows
$res = pg_query($select);
pg_num_rows