Re: PostgreSQL - PHP insert deleted from database immediately? - Mailing list pgsql-general

From Ricardo Campos Passanezi
Subject Re: PostgreSQL - PHP insert deleted from database immediately?
Date
Msg-id Pine.BSF.4.31L2.0104261148200.72340-100000@netuno.ige.unicamp.br
Whole thread Raw
In response to PostgreSQL - PHP insert deleted from database immediately?  ("Sami" <samihREM-ME@email.com>)
List pgsql-general
...
> The insert statement executed from php is:
>
>      $otsikko = "Insert testi";
>      $teksti = "Koeteksti 1";
>
>      $sqllause = "INSERT INTO jutut (otsikko,teksti) VALUES ('";
>      $sqllause = $sqllause . $otsikko . "','" . $teksti . "');";

Have you tried without the ";"? Just like:

$sqllause = "INSERT INTO jutut (otsikko,teksti) VALUES ('";
$sqllause = $sqllause . $otsikko . "','" . $teksti . "')";


I have similar stuff around here, and it works just fine.

The piece of code I have:

$connect = pg_connect("host=$host dbname=$db user=$user password=$pass");
$insert_query = "INSERT INTO table(field1,field2,...,fieldN)
VALUES('$field1','$field2',...,'$fieldN')";

$result = pg_exec($connect,$insert_query);

pg_close($connect);

Obs: the $insert_query is defined in one line...

Ricardo.


pgsql-general by date:

Previous
From: will trillich
Date:
Subject: crypt(table.field) ?
Next
From: "Gregory Wood"
Date:
Subject: Re: help with serial type