Re: prepared SELECT and placeholders with NULL values

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: prepared SELECT and placeholders with NULL values
Дата
Msg-id 20060325172947.GA23203@wolff.to
обсуждение исходный текст
Ответ на prepared SELECT and placeholders with NULL values  ("Michael Lea" <michael.lea@gmail.com>)
Список pgsql-general
On Thu, Mar 23, 2006 at 15:24:16 -0600,
  Michael Lea <michael.lea@gmail.com> wrote:
>
>   $s = $db->prepare('SELECT id FROM person WHERE lname = ? AND fname = ?');
>
> But this does not, returning an empty list:
>   $s->execute('Cher', undef);

= NULL will return NULL for every row and no rows will be selected by the
WHERE clause. This is how things are supposed to work according to the
standard.

It is hard to say what you might do without knowing more about what you
are doing, but a simple possibility may be to use the empty string ('') instead
of NULL in your data.

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Advantages of PostgreSQL over MySQL 5.0
Следующее
От: Chris Travers
Дата:
Сообщение: Re: Advantages of PostgreSQL over MySQL 5.0