On Saturday, June 1, 2002 at 5:35:03 PM, you wrote:
> Is there anything I should do to make the php.ini come into effect? I did
> put the register_global = On but still got empty values.

you may not need to do anything or you may need to restart your http server.
Have a look at your phpinfo() page. If it's picking up the php.ini file then it
will show it's filename as well as it's path.

> <?php
> $db = pg_connect("dbname=friends");
> $query = "INSERT INTO friends (id, firstname, surname) values 
>(nextval('friends_id_seq'), $_POST['firstname'], $_POST['surname'])";
> $result = pg_exec($db, $query);
> if (!$result) {
> printf ("ERROR");
> $errormessage = pg_errormessage($db);
> echo $errormessage;
> exit;
> }
> printf ("These values were inserted into the database - %s %s", $firstname, 
>$surname);
> pg_close();
?>>
> </body>
> </html>

Hmm, line 6 of that code would be printf ("ERROR"); but I'll assume that you
haven't included the first few lines and that line 6 is actually the pg_exec
line. You haven't changed $query as I suggested in a previous message. Change
the $query = line to the following...

$query = "INSERT INTO friends (id, firstname, surname) values
(nextval('friends_id_seq'), ".$_POST['firstname'].", ".$_POST['surname'].")";

-- 
Stuart


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to