How can I call a function to return a code fragement from within a pg_Exec - Mailing list pgsql-general

From Robert Chalmers
Subject How can I call a function to return a code fragement from within a pg_Exec
Date
Msg-id 36B3B5BA.58C40301@chalmers.com.au
Whole thread Raw
Responses Re: [GENERAL] How can I call a function to return a code fragement from within a pg_Exec  (Remigiusz Sokolowski <rems@gdansk.sprint.pl>)
List pgsql-general
Original.. This works, but needs calls to three tables. Where 'code' actually
holds all required info.
     $result = pg_Exec($database,"select code,title,price from catalog where (
title like '%$keyword%'  and category like '$category' and language like
'$language') order by code");


What I want to do, is just extract the records, that match the code, broken
down into category, and language.
     $result = pg_Exec($database,"select code,title,price from catalog where (
title like '%$keyword%'  and (foo($regs[1])) == '$category' and
(foo($regs[2])== '$language') order by code");
...................................................................
The foo() function is a call to an egreg thing,
    (ereg( "([0-9]{1,2})([A-Za-z]{1,3})(.*)", $t_code, $regs );)
which can return what I'm looking for,

I know these error messages are complaining about foo() being in the statement,
which is what I'm trying to solve.
Warning: PostgresSQL query failed: ERROR: No such function 'foo' with the
specified attributes in
/usr/local/apache/share/htdocs/php/book-2.php3 on line 120
Warning: 0 is not a PostgresSQL result index in
/usr/local/apache/share/htdocs/php/book-2.php3 on line
121


Thanks for any clues to this connundrum...

Robert

--
http://www.chalmers.com.au. Publications From China in 24 different languages.
English, French, German, Russian, Arabic, Spanish, Chinese, Burmese, Bengali,
Hindi, Indonesian, Italian, Japanese, Korean, Portuguese, Persian, Swahili,
Sinhalese, Thai, Tamil, Urdu, Vietnamese. China Books for CIBTC, Beijing.



pgsql-general by date:

Previous
From: astro
Date:
Subject: RE: [GENERAL] Inaccessible table?? (fwd)
Next
From: Thomas Reinke
Date:
Subject: Re: [GENERAL] Inaccessible table?? (fwd)