php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5990 problems in variable usage
Submitted: 2000-08-06 05:22 UTC Modified: 2000-08-06 05:56 UTC
From: greg at ruralnet dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.1pl2 OS: Debian GNU Linux 2.2
Private report: No CVE-ID: None
 [2000-08-06 05:22 UTC] greg at ruralnet dot com
We have php 4.0.0 running on this server, when we were using (having no problems) this:

$result=pg_exec("$database", $select);

Today we installed 4.0.1pl2 and started to get this 
failure:

Warning: Supplied argument is not a valid PostgreSQL result resource in /home/httpd/html/test/can_comunidad/clasificados/listado.php on line 141

Then, we moved into listado.php and we took away quotation marks from "$database". The problem was solved at that moment.
The fact was we use quotation marks everywhere within $database, so we started to find errors in EVERY script file having "$database" (of course, the same warning appeared).
We moved back to 4.0.0 version and the problem dissapeared.
We checked (diff method and manually) for differences between php.ini files, finding NOTHING DIFFERENT.

Hope you can get into and over it.

Ruralnet.com's CTO & server administration crew

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-06 05:56 UTC] rasmus@php.net
The pg_exec() function is documented to take a connection identifier, not a string.  The fact that it worked as a qouted string in the past was just a result of poor error checking on our part.  You will have to fix your code as this will stay like this from now on.

In general you should never put quotes around a single variable like that anyway.  It is both slower and error-prone (as you have discovered)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 20:00:02 2026 UTC