On Thu, Jan 06, 2005 at 14:38:53 -0800,
Aaron Steele <asteele@berkeley.edu> wrote:
> hi bruno,
Please copy replies to the list so that other people can help and learn
from your problem.
>
> here's the IF() from psql, although i'm not familiar enough to really
> know what to look for. do you see anything obviously wrong here? is
> there a better way to look at the IF() function?
> ........................................................................
> ......................................
> dmapdb=# \df+ if
>
> List of functions
> Result data type | Schema | Name | Argument data types | Owner |
> Language | Source code
> | Description
> ------------------+--------+------+---------------------+-------
> +----------
> +-----------------------------------------------------------------------
> -----------------------+-------------
> text | public | if | integer, text, text | dmap |
> plpgsql |
> BEGIN
> IF $1 THEN
> RETURN $2;
> END IF;
> IF NOT $1 THEN
> RETURN $3;
> END IF;
> END;
In the php code you showed the following fragment:
IF(l.last_comment_uid, cu.name, l.last_comment_name)
I doubt that l.last_comment_uid is a boolean based on its name.
If it isn't this is probably the source of your problem.