> I've got a table with the following structure:
>
> CREATE TABLE assignment_answers
> (
> training_id INT4,
> lesson_no INT2,
> assignment_no INT2,
> FOREIGN KEY( training_id, lesson_no, assignment_no ) REFERENCES
> assignment ON UPDATE CASCADE ON DELETE CASCADE,
> participants_id INT4,
> FOREIGN KEY( training_id, participants_id ) REFERENCES
> training_participants ON UPDATE CASCADE ON DELETE CASCADE,
> answer TEXT,
> isHTML boolean DEFAULT 'false',
> submitted TIMESTAMP DEFAULT now()
> );
>
> And I have a certain function which executes the following SQL_QUERY
> under PHP:
>
> SELECT * FROM assignment_answers;
>
> After execution I check my Result resource which has the following value
>
> RESULT_SET == []
>
> Warning: Supplied argument is not a valid PostgreSQL result resource,
res = pg_Exec( conn, "SELECT * FROM assignment_answers" );
if( pg_numrows( res ) != 0 ) {
for( i=0 ; i<pg_numrows( res ) ; ++i ) {
row = pg_fecharray( res, i );
/* do your stuff here */
}
} else {
/* report error or whatever */
}
Nix.