note 22131 rejected from function.pg-connect by jsheets

From: Date: Mon, 13 Jan 2003 04:22:20 +0000
Subject: note 22131 rejected from function.pg-connect by jsheets
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-42039@lists.php.net to get a copy of this message
A got a problem... with Mysql i can do this without problem.. <? function GetLabel($id) { global $host_db, $user_db, $password_db, $basedatos_db; $sql = "select label from table where idlabel='$id'"; $cnx = mysql_pconnect($host_db,$user_db,$password_db); mysql_select_db($basedatos_db,$cnx); $rst = mysql_db_query($basedatos_db,$sql,$cnx); $row = mysql_fetch_array($rst); mysql_close($cnx); return $row[0]; } $auxSQL = "select claveEdo, label from locales where claveEdo='uno'"; $cnx=mysql_pconnect("$host_db","$user_db","$password_db"); mysql_select_db("$basedatos_db",$cnx); $auxRST = mysql_db_query($basedatos_db,$auxSQL,$cnx); while ( ($auxROW=mysql_fetch_array($auxRST))) { ?> <? echo $claveEdo; ?> - <? echo getLabel($auxROW[0]; ?> <? } mysql_close($cnx); ?> /****/ if i try to use something similar with postgresql i got a warning in the conection close at the end of while. there is other way to do this?

« previous php.notes (#42039) next »