Mailinglist Archive: opensuse (3618 mails)

< Previous Next >
Re: [opensuse] php and postgres 9.3 vs 10.3
  • From: Cristian Rodríguez <crrodriguez@xxxxxxx>
  • Date: Mon, 26 Jan 2009 16:00:38 -0300
  • Message-id: <497E0856.5050806@xxxxxxx>
Robert Paulsen escribió:

The php code that is failing is:

$dbh=&$_SESSION['dbh'];
$cstring="dbname=$db_name host=localhost user=$user
password=$password";
$dbh=pg_connect($cstring)
or die("Could not connect to postgresql database $db_name");

Any clues?

Did you enabled error reporting ? set display_errors=On in php.ini

ps: that piece of code, does not make sense...first $dbh is assigned to
be a reference of $_SESSION['dbh'] (which is a real hack, what you want
seems to be the "singleton pattern" instead) but a line later it is
reasigned by value to be a postgresql resource.. no wonder if there is
other bug around...

--
"We have art in order not to die of the truth" - Friedrich Nietzsche

Cristian Rodríguez R.
Software Developer
Platform/OpenSUSE - Core Services
SUSE LINUX Products GmbH
Research & Development
http://www.opensuse.org/


< Previous Next >
Follow Ups
References