pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: GH <grasshacker@over-yonder.net>
To: Chadwick Rolfs <c2304182@webdevel.urban.csuohio.edu>
Cc: pgsql-php@postgresql.org
Subject: Re: Test
Date: Wed, 13 Jun 2001 17:52:06 -0500
Message-ID: <20010613175206.A18199@over-yonder.net> (raw)
In-Reply-To: <Pine.LNX.4.33.0106131732150.13453-100000@webdevel.urban.csuohio.edu>
References: <00ac01c0f448$5eb4be20$330a0a0a@rutgersinsurance.com>
	<Pine.LNX.4.33.0106131732150.13453-100000@webdevel.urban.csuohio.edu>

On Wed, Jun 13, 2001 at 05:38:30PM -0400, some SMTP stream spewed forth: 
> Well, thank you very much.  I hope that's not sarcasm I detect in this
> effort to educate the newbies.  I should mention that I am a newbie, I am
> constantly reading the documentation, and that I KNOW WHERE TO START.
> Here.  I got to this list from postgresql.org, and the php lists are tough
> to navigate (ie, i recieve, but can't seem to consistently post.)

This very much is sarcasm, but I think you deserve it. *shrug*.

You want to do something using PHP. I suppose that means you want
Documentation. PHP probably has some documentation up on its website, eh?
< www.php.net >. On the first page is a link to (*boggle*) documentation.
Function documentation would probably be in the manual. 
Ah, there we go, "Function Reference". Hm...PostgreSQL Functions...(*boing*).

> Maybe, since you seem to be "in the know", you can point out one of the
> pgsql/php functions you have mentioned instead of giving me useless
> information.  That would help...

This is a really basic use of PHP<->PostgreSQL...you would best be served
by a book (or online tutorial). It is not the duty of this list to tutor.

> If you look closely, you'll see that there is a problem, there is really
> no function that takes web form contents (yes the name=value pairs, not
> the html tags (w3.org can do that!)) and puts these into :

Of course not, such a thing would be silly.

> insert into <table_name> ($web_form_names) values ($web_form_values);
> 
> Is there anyoneELSE out there who can HELP me?  or give me some sort of
> constructive advice, instead of making me feel like I'm doing something
> horribly wrong, like adam here....

Depending on the settings in php.conf global variables may or may not be
set from form input. One of the following should work to get the value of
<input name="variable"...>:

$variable
$GLOBALS['variable']
$HTTP_POST_VARS['variable']
$HTTP_GET_VARS['variable']

You must first establish a connection to the PostgreSQL server:
$link=pg_connect('host=<host or do not specify for localhost> user=<user> 
	password=<password> dbname=<database name> port=5432');
Then, insert the values using a standard insert query:
pg_exec($link, 'insert into <table> values (\''.$variable.'\')');
which executies the query:
insert into <table> values ('$variable');

> Chadwick Rolfs
> 
*snip Adam's message*
> > Your best friend will be www.php.net.

Always a good idea, eh? ;-)
(Chadwick: you can do this by using the php function phpinfo(););

Try not to be so pleasant when asking other people to take time to help
you. As far as I know, none of us get paid to be here (which shouldn't
really matter anyway, you can't expect f****** magic all the time.

gh


> > Adam Lang
> > ----- Original Message -----
> > From: "Chadwick Rolfs" <c2304182@webdevel.urban.csuohio.edu>
> > > I can't seem to post to this list that I keep recieving e-mail from.  I
> > > want to parse a web form through php and put it into a postgresql
> > > batabase.  Who can help?  or point me toward the right direction...
> > > thanks.
> > > Chadwick Rolfs



view thread (15+ messages)  latest in thread

Message-ID: <20010613175206.A18199@over-yonder.net>
Permalink:  ../20010613175206.A18199@over-yonder.net/
Also on:    postgresql.org/message-id/20010613175206.A18199@over-yonder.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: grasshacker@over-yonder.net, c2304182@webdevel.urban.csuohio.edu
  Subject: Re: Test
  In-Reply-To: <20010613175206.A18199@over-yonder.net>
  References: <00ac01c0f448$5eb4be20$330a0a0a@rutgersinsurance.com> <Pine.LNX.4.33.0106131732150.13453-100000@webdevel.urban.csuohio.edu> <20010613175206.A18199@over-yonder.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox