Hello!
I want to thank everyone who replied to my question. I managed to solve my problem.
I followed Tomas' suggestion and added '::text' to query string. Ultimately, however, the problem was that the function
existedin another schema. (Thanks, Tom, for pointing me to this direction!) What I did was to add another pg_query,
justbefore the "main" query:
pg_query($yhteys, "SET search_path TO htyo;");
That did the trick!
Again, thanks for saving me hours of frustration.
Tuo