getting pg_connect error?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How does one get the error message from a bad pg_connect()?

I do:

	function open()
	{
		$rc = @pg_connect("db=wishiwhereusingmysql");

		if (!rc)
		{
			return(pg_last_error($rc)); // HERE it's broken
		}
		else
		{
			return ($rc);
		}
	}

But pg_last_error() doesn't work because $rc is a boolean and not a resource specifier.


Andrew



-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux