From: Gurudutt <guru@indvalley.com>
To: pgsql-php@postgresql.org
Subject: Re: PEAR Problem
Date: Tue, 9 Oct 2001 13:37:13 +0530
Message-ID: <9114697982.20011009133713@indvalley.com> (raw)
Hello Dan,
Thanks very much for the help. Ya I tried enclosing with the quotes on
that unfortunately it doesn't work, it gives error.
Here are source code for the files.
You can try creating a table names ACT_NetworkTab with 2 fields,
NetCode(Integer) and NetWorkName(Varchar)
This is the php code which is used to print the values
<?
//include new pgsql pear db file ...
require_once("pgsqlpear.php");
//verify for database server ...
if(!$db)
{
//error occured .. send him to Error page ...
echo "Database conenction failed (Line : 18)";
exit;
}
else
{
//Begin Transaction ..
$Begin_Query = "BEGIN";
$Begin_Result = $db->query($Begin_Query);
//Auto Commit Query ..
//$AutoCommit_Query = "SET autocommit=0";
//$AutoCommit_Result = $db->query($AutoCommit_Query);
$Query = "SELECT \"NetCode\",\"NetWorkName\" FROM
\"ACT_NetworkTab\"";
$Result = $db->query($Query);
if(DB::isError($Result))
{
//Do a Roll Back ....
$RoleBack_Query = "ROLLBACK";
$RoleBack_Result = $db->query($RoleBack_Query);
echo "Query Failed (line 38)";
exit;
}
else
{
while($Row = $Result->fetchrow())
{
echo
"NetCode:",$Row[NetCode]."---NetName:".$Row[NetworkName];
echo "<br>";
}
} //end of if db success ....
//Commit the operation here .....
$Commit_Query = "COMMIT";
$Commit_Result = $db->query($Commit_Query);
} //end of if submit ...
?>
This is the pgsql.php include file for Database connectivity
<?
$dbuser = "postgres";
$dbpassword = "postgres";
$dbhost = "localhost";
$dbname = "ACTBilling";
require_once("DB.php");
$db = DB::connect("pgsql://$dbuser:$dbpassword@$dbhost/$dbname");
if(DB::isError($db))
{
$db = 0;
echo $db->getMessage();
}
else
{
$db->setFetchMode(DB_FETCHMODE_ASSOC);
}
?>
Please try and help me!!
--
Best regards,
Gurudutt mailto:guru@indvalley.com
Life is not fair - get used to it.
Bill Gates
Tuesday, October 09, 2001, 9:34:24 AM, you wrote:
DW> This is caused by the fact that PostgreSQL is case insensitive. In order
DW> for it to actually take the case into account, you need quote your field
DW> names and table names.
DW> So your query would then be: select "NetCode","NetworkName" from
DW> "NetworkTab";
DW> Then you would be able to access the fields with $dbRow[NetworkName].
DW> -Dan
DW> : Hi,
DW> :
DW> : It's me again. I have been ab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: guru@indvalley.com
Subject: Re: PEAR Problem
In-Reply-To: <9114697982.20011009133713@indvalley.com>
References: <9114697982.20011009133713@indvalley.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox