Re: php insert problem

From: <peter(at)jingo(dot)com>
To: <dan(at)radom(dot)org>, <pgsql-php(at)postgresql(dot)org>
Subject: Re: php insert problem
Date: 2002-05-22 15:45:28
Message-ID: 00ab01c201a7$b2ba8690$3d002eac@Peter
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

You're missing a closing )

$result = pg_exec ($database, "INSERT into employees (emp_name, emp_email)
VALUES ('$emp_name','$emp_email')");

Peter

----- Original Message -----
From: "dan radom" <dan(at)radom(dot)org>
To: <pgsql-php(at)postgresql(dot)org>
Sent: Wednesday, May 22, 2002 4:06 PM
Subject: [PHP] php insert problem

> <snip>
>
> $database = pg_connect ("host=localhost dbname=rbak user=nobody") or
die("database connection failed");
> $result = pg_exec ($database, "INSERT into employees (emp_name,
emp_email) VALUES ('$emp_name','$emp_email')";
>
> if (!$result) {
> echo "query died\n";
> exit;
> }
>
> </snip>
>
> the above code produces a parse error. "parse error, unexpected ';' in
blah.php on line X"
>
> line X is the $result = pg_exec ($database, "INSERT into employees
(emp_name, emp_email) VALUES ('$emp_name','$emp_email')"; line. I've
started at this long enough, and it's time for other eyes to look. any
ideas? similar SELECT queries work just fine.
>
> dan
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Matteo Beccati 2002-05-22 15:46:42 Re: php insert problem
Previous Message Chris Thompson 2002-05-22 15:41:15 Re: php insert problem