string = any()

Поиск
Список
Период
Сортировка
Искать
От
Andy Colson
Тема
string = any()
Дата
Msg-id
4F0C5371.2090702@squeakycode.net
Список
Дерево обсуждения
string = any() Andy Colson <andy@squeakycode.net>
Re: string = any() "David Johnston" <polobo@yahoo.com>
Re: string = any() Andy Colson <andy@squeakycode.net>
Re: string = any() "David Johnston" <polobo@yahoo.com>
Re: string = any() Andy Colson <andy@squeakycode.net>
Re: string = any() "David Johnston" <polobo@yahoo.com>
Re: string = any() Andy Colson <andy@squeakycode.net>
Re: string = any() Tom Lane <tgl@sss.pgh.pa.us>
Re: string = any() Andy Colson <andy@squeakycode.net>
Re: string = any() Tom Lane <tgl@sss.pgh.pa.us>
Re: string = any() John R Pierce <pierce@hogranch.com>
Re: string = any() Filip Rembiałkowski <plk.zuber@gmail.com>
Re: string = any() Andy Colson <andy@squeakycode.net>
Re: string = any() Filip Rembiałkowski <plk.zuber@gmail.com>
Re: string = any() "David Johnston" <polobo@yahoo.com>
Re: string = any() Filip Rembiałkowski <plk.zuber@gmail.com>
Hi all.

I am writing PHP where it prepares a statement like:
$sql = 'select * from aTable where id = any($1)';

then in php I create a string:
$args = "{1,2,3}";

And run it:

$q = pg_query_params($db, $sql, $args);

This is not actual code, just a sample.  And it works great for 
integers.  I cannot get it to work with strings.

Just running this in psql does not work either:
select 'bob' = any( '{''joe'', ''bob'' }' )

But this does:
select 'bob' = any( array['joe', 'bob'] )

But I can't seem to prepare and execute:
$sql = "select 'bob' = any( $1 )";
$args = "array['joe', 'bob']";
$q = pg_query_params($db, $sql, $args);

Running on 9.0.4 on Slackware 64.

Any hits would be appreciated.

-Andy
В списке pgsql-general по дате отправления
От: Alban Hertroys
Дата:
От: Filip Rembiałkowski
Дата:
Сообщение: Re: string = any()
FAQ