pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Self <jself@nngov.com>
To: pgsql-php@postgresql.org
Subject: Trouble with SQL statement using variable
Date: 29 Jan 2002 13:34:51 -0500
Message-ID: <1012329292.14152.5.camel@personnel_test> (raw)

I'm having trouble getting an SQL statement to use a variable. Here's
the statement:

		$sql = "SELECT emp_fname FROM employee WHERE username = '$username'";
		$result = pg_exec($conn,$sql);
			if (!$result) {
				exit;
			}
I get the following warning from this:

Warning: Supplied argument is not a valid PostgreSQL link resource in
/var/www/personnel/include/functions.inc on line 25

Is there another way to use a variable in an SQL statement. This format
works with MySQL.

-- 
Jeff Self
Information Technology Analyst
Department of Personnel
City of Newport News
2400 Washington Ave.
Newport News, VA 23607
757-926-6930




view thread (5+ messages)  latest in thread

Message-ID: <1012329292.14152.5.camel@personnel_test>
Permalink:  ../1012329292.14152.5.camel@personnel_test/
Also on:    postgresql.org/message-id/1012329292.14152.5.camel@personnel_test

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: jself@nngov.com
  Subject: Re: Trouble with SQL statement using variable
  In-Reply-To: <1012329292.14152.5.camel@personnel_test>
  References: <1012329292.14152.5.camel@personnel_test>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox