pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedphp insert problem
7+ messages / 6 participants
[nested] [flat]
* php insert problem
@ 2002-05-22 15:06 dan radom <dan@radom.org>
2002-05-22 15:33 ` Re: php insert problem Chadwick Rolfs <cmr@shell.gis.net>
2002-05-22 15:35 ` Re: php insert problem Surojit Niyogi <surojit@bungeecode.com>
2002-05-22 15:41 ` Re: php insert problem Chris Thompson <thompson@ednet.co.uk>
2002-05-22 15:45 ` Re: php insert problem peter@jingo.com
0 siblings, 4 replies; 7+ messages in thread
From: dan radom @ 2002-05-22 15:06 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: php insert problem
2002-05-22 15:06 php insert problem dan radom <dan@radom.org>
@ 2002-05-22 15:33 ` Chadwick Rolfs <cmr@shell.gis.net>
3 siblings, 0 replies; 7+ messages in thread
From: Chadwick Rolfs @ 2002-05-22 15:33 UTC (permalink / raw)
To: dan radom <dan@radom.org>; +Cc: pgsql-php
You need to close your parenthesis after the last double quote.
On Wed, 22 May 2002, dan radom wrote:
> <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
>
-Chadwick
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: php insert problem
2002-05-22 15:06 php insert problem dan radom <dan@radom.org>
@ 2002-05-22 15:35 ` Surojit Niyogi <surojit@bungeecode.com>
3 siblings, 0 replies; 7+ messages in thread
From: Surojit Niyogi @ 2002-05-22 15:35 UTC (permalink / raw)
To: dan@radom.org <dan@radom.org>; +Cc: pgsql-php
Hi Dan,
You're missing a close parentheses ")" in the pg_exec line... :)
Roj Niyogi
pgHoster.com
PostgreSQL web hosting
dan radom wrote:
><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
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: php insert problem
2002-05-22 15:06 php insert problem dan radom <dan@radom.org>
@ 2002-05-22 15:41 ` Chris Thompson <thompson@ednet.co.uk>
2002-05-22 16:53 ` Re: php insert problem Chadwick Rolfs <cmr@shell.gis.net>
3 siblings, 1 reply; 7+ messages in thread
From: Chris Thompson @ 2002-05-22 15:41 UTC (permalink / raw)
To: dan radom <dan@radom.org>; +Cc: pgsql-php
Should it not be
$result = pg_exec ($database, "INSERT into employees (emp_name, emp_email) VALUES ('$emp_name','$emp_email');");
Cheers
On Wed, 22 May 2002, dan radom wrote:
> <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
> --
> Virus scanned by edNET.
>
--
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender. Any
offers or quotation of service are subject to formal specification.
Errors and omissions excepted. Please note that any views or opinions
presented in this email are solely those of the author and do not
necessarily represent those of edNET or lightershade ltd. Finally, the
recipient should check this email and any attachments for the presence of
viruses. edNET and lightershade ltd accepts no liability for any damage
caused by any virus transmitted by this email.
--
--
Virus scanned by edNET.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: php insert problem
2002-05-22 15:06 php insert problem dan radom <dan@radom.org>
2002-05-22 15:41 ` Re: php insert problem Chris Thompson <thompson@ednet.co.uk>
@ 2002-05-22 16:53 ` Chadwick Rolfs <cmr@shell.gis.net>
0 siblings, 0 replies; 7+ messages in thread
From: Chadwick Rolfs @ 2002-05-22 16:53 UTC (permalink / raw)
To: pgsql-php; +Cc: dan radom <dan@radom.org>
Hey, dan... are you getting these messages? It seems we have a consensus.
Do you still get an error?
On Wed, 22 May 2002, Chris Thompson wrote:
> Should it not be
>
> $result = pg_exec ($database, "INSERT into employees (emp_name, emp_email) VALUES ('$emp_name','$emp_email');");
>
> Cheers
>
> On Wed, 22 May 2002, dan radom wrote:
>
> > <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
> > --
> > Virus scanned by edNET.
> >
>
> --
>
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> If you have received this email in error please notify the sender. Any
> offers or quotation of service are subject to formal specification.
> Errors and omissions excepted. Please note that any views or opinions
> presented in this email are solely those of the author and do not
> necessarily represent those of edNET or lightershade ltd. Finally, the
> recipient should check this email and any attachments for the presence of
> viruses. edNET and lightershade ltd accepts no liability for any damage
> caused by any virus transmitted by this email.
>
> --
> --
> Virus scanned by edNET.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
-Chadwick
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: php insert problem
2002-05-22 15:06 php insert problem dan radom <dan@radom.org>
@ 2002-05-22 15:45 ` peter@jingo.com
3 siblings, 0 replies; 7+ messages in thread
From: peter@jingo.com @ 2002-05-22 15:45 UTC (permalink / raw)
To: dan@radom.org; 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@radom.org>
To: <pgsql-php@postgresql.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
>
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: php insert problem
@ 2002-05-22 15:46 Matteo Beccati <m.beccati@crpsoftware.it>
0 siblings, 0 replies; 7+ messages in thread
From: Matteo Beccati @ 2002-05-22 15:46 UTC (permalink / raw)
To: pgsql-php
Hi,
It seems you forgot closing the php function arguments with ')':
$result = pg_exec ($database, "INSERT into employees
(emp_name, emp_email) VALUES ('$emp_name','$emp_email')");
This should work
Regards
--
Matteo Beccati
http://www.phpadsnew.com
http://phppgads.sourceforge.net
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2002-05-22 16:53 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-05-22 15:06 php insert problem dan radom <dan@radom.org>
2002-05-22 15:33 ` Chadwick Rolfs <cmr@shell.gis.net>
2002-05-22 15:35 ` Surojit Niyogi <surojit@bungeecode.com>
2002-05-22 15:41 ` Chris Thompson <thompson@ednet.co.uk>
2002-05-22 16:53 ` Chadwick Rolfs <cmr@shell.gis.net>
2002-05-22 15:45 ` peter@jingo.com
2002-05-22 15:46 Re: php insert problem Matteo Beccati <m.beccati@crpsoftware.it>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox