Re: PHP Related Problem

Поиск
Список
Период
Сортировка
От Nikola Milutinovic
Тема Re: PHP Related Problem
Дата
Msg-id 005601c1471e$ebbe9010$0a3ea8c0@ev.co.yu
обсуждение исходный текст
Ответ на PHP Related Problem  (John Clark Naldoza y Lopez <njclark@ntsp.nec.co.jp>)
Список 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.

В списке pgsql-general по дате отправления:

Предыдущее
От: Russ McBride
Дата:
Сообщение: make problems on Apple's new 10.1 os
Следующее
От: John Clark Naldoza y Lopez
Дата:
Сообщение: Re: PHP Related Problem