Problem scenario
You have a PHP web page that integrates with Postgres behind the scenes. You find that when a SQL command returns nothing (e.g., when a table name is used and it is known to not exist in the underlying database), the PHP web page is blank. You want the result to be more clear about what happened or potentially happened. How do you handle an exception or commonly occurring SQL query with no results using PHP?
…