php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18386 Select not case sensitive in pg_exec
Submitted: 2002-07-17 03:52 UTC Modified: 2002-07-17 04:27 UTC
From: roach_md at mindspring dot com Assigned:
Status: Not a bug Package: PostgreSQL related
PHP Version: 4.1.2 OS: Solaris 8
Private report: No CVE-ID: None
 [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.";




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-17 04:28 UTC] edink@php.net
This is not a PHP bug. You need to enclose attributes in double quotes (") if you want the case preserved. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 10 20:01:26 2024 UTC