| From: | "Nikola Milutinovic" <Nikola(dot)Milutinovic(at)ev(dot)co(dot)yu> |
|---|---|
| To: | "John Clark Naldoza y Lopez" <njclark(at)ntsp(dot)nec(dot)co(dot)jp> |
| Cc: | "PostgreSQL general" <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: PHP Related Problem |
| Date: | 2001-09-27 06:37:46 |
| Message-ID: | 005601c1471e$ebbe9010$0a3ea8c0@ev.co.yu |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
> 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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | John Clark Naldoza y Lopez | 2001-09-27 07:04:12 | Re: PHP Related Problem |
| Previous Message | Russ McBride | 2001-09-27 06:34:26 | make problems on Apple's new 10.1 os |