Re: E_PARSE error ?

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: E_PARSE error ?
Дата
Msg-id dcc563d10806091600v359f95d2uba1799dca55a660a@mail.gmail.com
обсуждение исходный текст
Ответ на E_PARSE error ?  (PJ <af.gourmet@videotron.ca>)
Список pgsql-general
On Tue, Jun 3, 2008 at 10:14 AM, PJ <af.gourmet@videotron.ca> wrote:
> I'm using php5, postgresql 8.3, apache2.2.8, FreeBSD 7.0
> I don't understand the message:
>
> *Parse error*: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
> T_STRING or T_VARIABLE or T_NUM_STRING
>
> the guilty line is:
>
> list($page_id)=sqlget("
>       select page_id from pages where name='$_SERVER['SCRIPT_NAME']'");

Inside quotes, you need to remove the single quotes around your array
index.  Seems wrong, I know, but that's what php says to do.  I prefer
to concatenate.  so either:

list($page_id)=sqlget("select page_id from pages where
name='$_SERVER[SCRIPT_NAME]'");


list($page_id)=sqlget("select page_id from pages where
name=".$_SERVER['SCRIPT_NAME'].");

are legal.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump, COPY and inheritance
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Bottom Posting