Bug #18386 Updated: Select not case sensitive in pg_exec

From: Date: Wed, 17 Jul 2002 08:28:00 +0000
Subject: Bug #18386 Updated: Select not case sensitive in pg_exec
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14391@lists.php.net to get a copy of this message
ID: 18386 Updated by: edink@php.net Reported By: roach_md@mindspring.com -Status: Open +Status: Bogus Bug Type: PostgreSQL related Operating System: Solaris 8 PHP Version: 4.1.2 New Comment: This is not a PHP bug. You need to enclose attributes in double quotes (") if you want the case preserved. Previous Comments: ------------------------------------------------------------------------ [2002-07-17 03:52:41] roach_md@mindspring.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."; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18386&edit=1

« previous php.bugs (#14391) next »