| From: | "Mitch Vincent" <mvincent(at)cablespeed(dot)com> | 
|---|---|
| To: | "John Clark Naldoza y Lopez" <njclark(at)ntsp(dot)nec(dot)co(dot)jp>, <pgsql-general(at)postgresql(dot)org> | 
| Subject: | Re: PHP Related Problem | 
| Date: | 2001-09-26 13:24:22 | 
| Message-ID: | 004101c1468e$8ea03950$e57d5dd8@mitch | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Can you show the PHP you're using to connect to and query the database?
Just an FYI but there is a pgsql-php list too :-)
-Mitch
----- Original Message -----
From: "John Clark Naldoza y Lopez" <njclark(at)ntsp(dot)nec(dot)co(dot)jp>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Wednesday, September 26, 2001 8:24 AM
Subject: [GENERAL] PHP Related Problem
> Hi,
>
>
> 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,
>
> When I use psql to access the data this is what I get:
>
> train=> SELECT * FROM assignment_answers ;
>  training_id | lesson_no | assignment_no | participants_id | answer |
> ishtml |       submitted
> -------------+-----------+---------------+-----------------+--------+-----
---+------------------------
>            1 |         1 |             1 |               1 | aaa    |
> f      | 2001-09-26 20:10:59+08
>            1 |         1 |             2 |               1 | sddd   |
> t      | 2001-09-26 20:10:59+08
>            1 |         1 |             3 |               1 | bbb    |
> f      | 2001-09-26 20:10:59+08
> (3 rows)
>
> How can this be?
>
> When all my other statements work find...  Even INSERTing and UPDATEing
> to this table works...  I just can't access it's data... =(
>
> I've got PHP 4.0.4 and PostgreSQL 7.0.3 installed in my test system.
>
> Hope someone can shed some light over here...  even RTFM would be great,
> if you can point me to where it is in the FM =)
>
> Cheers,
>
>
> John Clark
>
> --
>      /) John Clark Naldoza y Lopez                           (\
>     / )    Software Design Engineer III                      ( \
>   _( (_    _  Web-Application Development                    _) )_
>  (((\ \>  /_>    Cable Modem Network Management System <_\  </ /)))
>  (\\\\ \_/ /         NEC Telecom Software Phils., Inc.  \ \_/ ////)
>   \       /                                              \       /
>    \    _/  phone: (+63 32) 233-9142 loc. 3113            \_    /
>    /   /  cellphone: (+63 919) 399-4742                     \   \
>   /   / email: njclark(at)ntsp(dot)nec(dot)co(dot)jp                        \   \
>
>
> "Intelligence is the ability to avoid doing work, yet getting the work
> done"
> --Linus Torvalds
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mihai Gheorghiu | 2001-09-26 13:29:19 | Re: postgresql.conf | 
| Previous Message | wsheldah | 2001-09-26 13:03:14 | Re: fun in redmond |