|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-07-17 03:52 UTC] roach_md at mindspring dot com
Problem:
My queries with case sensitive table names get submitted in all lower case through pg_exec.
DB:
postgresql 7.2
Error Log:
[17-Jul-2002 03:34:04] PHP Warning: PostgreSQL query failed: ERROR: Attribute 'statecode' not found
in /opt/apache/wwwroot/mytest.asp on line 10
Script:
<?php
include_once("./db.tpl");
echo "<BR><BR>Testing Database Connection<br>";
$connection = pg_connect ("host=myhost port=5432 dbname=$site_db
user=$site_user password=$site_pw");
if ($connection){
echo "Connection Established <br>";
$resultid = pg_exec ($connection, "SELECT StateCode FROM states");
if ( $resultid ){
$rows = pg_numrows($resultid);
print $rows . "<br>";
print "State" . "<select name=\"state\">";
for ( $i = 0; $i < $rows; $i++ ){
list($state) = pg_fetch_row($resultid,$i);
print "<option>" . $state;
}
print "</select><br>";
}
else
print "Query Failed.";
pg_close($connection);
}
else
echo "<br>Could not connect to database.";
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
This is not a PHP bug. You need to enclose attributes in double quotes (") if you want the case preserved.