Bug #18386: Select not case sensitive in pg_exec
| From: | roach_md at mindspring dot com | Date: | Wed, 17 Jul 2002 07:52:42 +0000 |
| Subject: | Bug #18386: Select not case sensitive in pg_exec | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-14384@lists.php.net to get a copy of this message | ||
From: roach_md@mindspring.com
Operating system: Solaris 8
PHP version: 4.1.2
PHP Bug Type: PostgreSQL related
Bug description: Select not case sensitive in pg_exec
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.";
--
Edit bug report at http://bugs.php.net/?id=18386&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18386&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18386&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18386&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18386&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18386&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18386&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18386&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18386&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18386&r=globals