Trouble with SQL statement using variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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



[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux