[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Postgres, php question



On Thu, Jun 25, 1998 at 12:27:56PM +1000, Hamish Moffatt wrote:
> On Wed, Jun 24, 1998 at 07:51:19AM -0400, Paul McDermott wrote:
> > hello my debian user friends,  I've installed Postgres.deb, php3.deb,
> > apache.deb and www-pgsql from the slink area. I've done the postgres
> > tutorial and it was great.  Now i want to start on makeing a web interface
> > for a database i put together.  I read through the documentation, but i am
> > confused.  Is there a tutorial for the php3 program?  If so where can i
> 
> That's why I got in to www-sql in the first place -- it is easier to use/learn
> than php but is less flexible as a result. I have done some reasonably
> advanced stuff with www-sql and have created some big messes to do it.

FWIW, I read the beginning of this thread this morning, then installed
php3 and php3-pgsql, and now have some wickedly nice code.  I don't know
how I ever lived without php3 before!  It is so sweet!  I've already
replaced most of my shtml and CGI with it.  The learning curve is very
short if you know C.

If anyone needs any specific help, please let me know.

To make php3-pgsql work, you have to enable it in /etc/php3.ini.  Then
you just do simple stuff like:

<?
$db=pg_connect("","","","","dbname");
$res=pg_exec("select foo from bar");
$rows = pg_NumRows ($res);
echo("select returned $res rows.");
   ... etc ...
?>

and so on.

I still haven't done a form with it yet, but that's next on my agenda.

One of the niftier things you can do is write functions and include them
from any web page...  I'm impressed.  It's fast, too.

Jeff


--  
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: