Re: getting pg_connect error?

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

 



Cornelia Boenigk wrote:
Hi Andrew


You're right.  That was a typo in the newsgroup, but pg_last_error()
still doesn't work because $rc is boolean, not a resouce connection

type. If your connection to the database server fails you cannot get any error-message from the server ;-)

I can do it with PHP and MySQL! =)


How about this. Can I list PostgreSQL database files from PHP? With MySQL and PHP, I just connect to the server. Then, I can query whether the database file exists ("SHOW DATABASES"). If not, I create it. How do I do that with PostgreSQL?


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

if (!$rc)
{
echo "Connection failed";
}
else
{
return ($rc);
}
}

Regards
Conni






--
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