php insert problem

From: dan radom <dan(at)radom(dot)org>
To: pgsql-php(at)postgresql(dot)org
Subject: php insert problem
Date: 2002-05-22 15:06:23
Message-ID: 20020522150623.GJ31531@lunar.radom.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

<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

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Chadwick Rolfs 2002-05-22 15:33:05 Re: php insert problem
Previous Message Keary Suska 2002-05-20 16:27:08 Re: unable to insert rows with php