note 22131 added to function.pg-connect
| From: | dperez at unimayab dot edu dot mx | Date: | Fri, 07 Jun 2002 16:39:42 +0000 |
| Subject: | note 22131 added to function.pg-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31569@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?
--
http://www.php.net/manual/en/function.pg-connect.php
http://master.php.net/manage/user-notes.php?action=edit+22131
http://master.php.net/manage/user-notes.php?action=delete+22131
http://master.php.net/manage/user-notes.php?action=reject+22131