Page 1 of 1

remove connection, what does application do

Posted: Mon May 31, 2010 6:33 am
by johnhelen
I have a code

Code: Select all


<?
  pg_connect("dbname=mydb user=myuser");
  $myresult = pg_exec("SELECT * FROM id,username,fname,lname where id > 100");
?>
Any problem if I remove the first line pg_connect("dbname=mydb user=myuser") and now I only have

Code: Select all

<?
  $myresult = pg_exec("SELECT * FROM id,username,fname,lname where id > 100");
?>
I know that I will have $myresult = null but I want to know what will happen. Does the application slow down as it looks for a database connection? Does it throw an error?

Many thanks
john

Re: remove connection, what does application do

Posted: Sat Jun 05, 2010 6:46 pm
by John Cartwright
I hate to say this ever, but this can be easily answered by yourself if you simply tried it. Just make sure you have display_errors enabled and your error reporting set to atleast E_ALL.

I.e.,

Code: Select all

ini_set('display_errors', true);
error_reporting(E_ALL);