Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Bad field offset


Message #1 by "arun" <arun@l...> on Thu, 22 Aug 2002 14:53:58 +0530

I'm really really really confused here, arun...

> $fieldname = pg_fieldname($ResultSet, $column);
> $fieldnum=pg_fieldnum ($ResultSet, $fieldname);
> $fieldtype=pg_fieldtype($ResultSet, $fieldnum);
> if ($fieldtype == "timestamp")
>    echo "This is type: ".$fieldtype;


According to your code, you first have the column number of the field, which
you use to get the field name.

THEN, you use that name to get the column number??  Didn't you already have
the column number in $column???


Also, you should consider replacing pg_fieldname() with pg_field_name(),
pg_fieldnum() with pg_field_num(), and pg_fieldtype with pg_field_type().


nik


  Return to Index