Re: [GENERAL] ' syntax

Поиск
Список
Период
Сортировка
От Brett W. McCoy
Тема Re: [GENERAL] ' syntax
Дата
Msg-id Pine.BSI.3.91.990601150105.25048G-100000@access1.lan2wan.com
обсуждение исходный текст
Ответ на ' syntax  (amarof <amarof@marwan.ac.ma>)
Список pgsql-general
On Sat, 5 Jun 1999, amarof wrote:

> i got your answers about the syntax, it works with the strings, but when
> etat takes a variable value, it gives a parser error. example : select *
> from table where field like $txt
> the error occurs when txt takes the value (doctortat d'etat).

Is this in Perl or PHP3?  You should be doing it like:

"select * from table where field like '$txt';"

It's especially important that your query string be delimited by double
quotes in Perl, or it won't interpolate your variable.  If unsure, use
the generic quote facility:

qw(select * from table where field like '$txt';)

where the parentheses are functioning as quote characters.

Brett W. McCoy
                                         http://www.lan2wan.com/~bmccoy
-----------------------------------------------------------------------
It's not enough to be Hungarian; you must have talent too.
        -- Alexander Korda


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] Data recovery
Следующее
От: amarof
Дата:
Сообщение: ' syntax (using PHP3)