Re: Test - Mailing list pgsql-php

From GH
Subject Re: Test
Date
Msg-id 20010613175206.A18199@over-yonder.net
Whole thread Raw
In response to Re: Test  (Chadwick Rolfs <c2304182@webdevel.urban.csuohio.edu>)
List pgsql-php
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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)




pgsql-php by date:

Previous
From: "mike"
Date:
Subject: Re: Test
Next
From: Chadwick Rolfs
Date:
Subject: Test (fwd)