Trouble with SQL statement using variable

Поиск
Список
Период
Сортировка
От Jeff Self
Тема Trouble with SQL statement using variable
Дата
Msg-id 1012329292.14152.5.camel@personnel_test
обсуждение исходный текст
Ответы Re: Trouble with SQL statement using variable
Re: Trouble with SQL statement using variable
Список pgsql-php
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


В списке pgsql-php по дате отправления:

Предыдущее
От: "Mitch Vincent"
Дата:
Сообщение: Re: pg_pconnect - ??
Следующее
От: Frank Bax
Дата:
Сообщение: Re: Trouble with SQL statement using variable