Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5DD7B475BEC for ; Sat, 26 Oct 2002 14:39:40 -0400 (EDT) Received: from web10404.mail.yahoo.com (web10404.mail.yahoo.com [216.136.130.96]) by postgresql.org (Postfix) with SMTP id C75AA47580B for ; Sat, 26 Oct 2002 14:39:39 -0400 (EDT) Message-ID: <20021026183940.32531.qmail@web10404.mail.yahoo.com> Received: from [65.40.96.235] by web10404.mail.yahoo.com via HTTP; Sat, 26 Oct 2002 11:39:40 PDT Date: Sat, 26 Oct 2002 11:39:40 -0700 (PDT) From: Bruce Young Subject: Re: can't retrieve data through PHP To: pgsql-php@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/63 X-Sequence-Number: 1578 thanks guys for the quick response and tips. everything works well now. dont know how i didnt catch that one.. :) - bruce --- Chadwick Rolfs wrote: > Your variables don't match. And your coding is very inconsistent. > The if > construct should follow the for construct. It makes everything > READABLE > and understandable. > Good luck > > On Sat, 26 Oct 2002, Bruce Young wrote: > > > php connection query: > > > > > #include('DB/pgsql.php'); > > > > $dbconnect = pg_connect("dbname=campus user=apache"); > > HERE YOU HAVE DBCONNECT > > > > > > > $result = pg_exec ($conn, "select * from friends"); > > HERE YOU HAVE CONN > > > if (!result) {printf ("Error\n"); exit;} > > > > $numrows = pg_num_rows($result); > > > > for ($i=0; $i < $numrows; $i++) { > > $r = pg_fetch_row($result, $i); > > > > for ($j=0; $j < count($r); $j++) { > > echo "$r[$j] "; > > } > > echo "
"; > > } > > pg_close($dbconnect); > > ?> > > > > > > --- dan radom wrote: > > > * Bruce Young (hbrucey@yahoo.com) wrote: > > > > my script that does insert works correctly, but i get this > error > > > when > > > > retrieving data: > > > > > > > > Warning: pg_exec(): supplied argument is not a valid > PostgreSQL > > > link > > > > resource in /home/httpd/htdocs/view.php on line 115 > > > > > > > > Warning: pg_num_rows(): supplied argument is not a valid > > > PostgreSQL > > > > result resource in /home/httpd/htdocs/view.php on line 118 > > > > > > > > > > how about showing us the connection and query parts of view.php > > > > > > dan > > > > > > ---------------------------(end of > > > broadcast)--------------------------- > > > TIP 2: you can get off all lists at once with the unregister > > > command > > > (send "unregister YourEmailAddressHere" to > > majordomo@postgresql.org) > > > > > > __________________________________________________ > > Do you Yahoo!? > > Y! Web Hosting - Let the expert host your web site > > http://webhosting.yahoo.com/ > > > > ---------------------------(end of > broadcast)--------------------------- > > TIP 2: you can get off all lists at once with the unregister > command > > (send "unregister YourEmailAddressHere" to > majordomo@postgresql.org) > > > > -Chadwick > __________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/