"Ktt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hello,

> I have a strange problem - unable to insert data in to
> postgresql table, the script inserts only empty rows.
> (if i change variables $firstname and $surname to
> strings, the script works.)
> Maybe the problem in configuration of PHP?

Yes, it is a configuration problem...

The default for register_globals has changed latetly...

Try using the recommended new way.

  ${_GET["firstname"]}

and

  ${_GET["surname"]}

instead.

> <?
> echo "<form action=\"pgsqltest01.php\"
> method=\"get\">";
> echo "First Name : <input type=\"text\"
> name=\"firstname\"  value=\"FirstName\">";
> echo "<BR> Surname : <input type=\"text\"
> name=\"surname\"  value=\"Surname\">";
> echo "<BR><input type=\"submit\" name=\"su\"
> value=\"Submit\">";
> echo " <input type=\"reset\" name=\"reset\"
> value=\"Clear It\"></form>";

> $db = pg_connect("dbname=friends user=postgres");

> if ($su!='')
> {
> $query4 = "INSERT INTO friends (id, firstname,
> surname) values (nextval('friends_id_seq'),
> '$firstname', '$surname')";
> $result = pg_exec($db, $query4);
> }
> pg_close();

> ?>




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

Reply via email to