pg_exec : problem - Mailing list pgsql-novice

From Andy Arledge
Subject pg_exec : problem
Date
Msg-id NDBBJNOEGLGKLPGMIGKPCEAFCCAA.mrgburg@worldnet.att.net
Whole thread Raw
List pgsql-novice
can someone please give me an idea why the 3rd pg_exec won't retrieve the
info from the table.
$link, $t, $userzip, $foundzip - are all global variables, the 1st two
pg_exec's work great.

thanks in advance,

Andy Arledge
$link = pg_connect("host=localhost dbname=nsingles user=purcell");
  if(!($link)){
    DisplayErrMsg(sprintf("Error connecting to host %s, by user %s",
$hostname, $username));
    exit();
  }


if(!($result= pg_exec($link, "SELECT * from info1 where username='$to';")))
{
DisplayErrMsg(sprintf("Error in executing line %s stmt", $selectStmt));
        //exit();
}

// get users zip;
    if(!($result2= pg_exec($link, "SELECT * from signup where
username='$uname';"))){
           DisplayErrMsg(sprintf("Error in executing line %s stmt",
$selectStmt));
           //exit();
         }
     $t = @pg_fetch_object($result2, 0);
     $userzip = $t->zipcode;

// get results zip;
    if(!($result3= pg_exec($link, "SELECT * from signup where
username='$to';"))){
           DisplayErrMsg(sprintf("Error in executing line %s stmt",
$selectStmt));
           //exit();
     }

    $t = @pg_fetch_object($result3, 0);
     $foundzip = $t->zipcode;

Attachment

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Inserting TEXT with multiple lines
Next
From: Leandro Fanzone
Date:
Subject: Data directory destroyed