| From: | Ricardo Campos Passanezi <riccp(at)ige(dot)unicamp(dot)br> |
|---|---|
| To: | Sami <samihREM-ME(at)email(dot)com> |
| Cc: | <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: PostgreSQL - PHP insert deleted from database immediately? |
| Date: | 2001-04-26 14:54:16 |
| Message-ID: | Pine.BSF.4.31L2.0104261148200.72340-100000@netuno.ige.unicamp.br |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Thomas Lockhart | 2001-04-26 14:58:14 | Re: [GENERAL] Re: Hardcopy docs available |
| Previous Message | Peter Eisentraut | 2001-04-26 14:47:13 | Re: configure on a P4? |