Odd "INSERT" Problems with PostgreSQL - Do YOU know?

From: "Jason" <jason(at)op480(dot)com>
To: <pgsql-general(at)postgresql(dot)org>, <php-general-help(at)lists(dot)php(dot)net>, <php-db-help(at)lists(dot)php(dot)net>
Subject: Odd "INSERT" Problems with PostgreSQL - Do YOU know?
Date: 2001-05-24 08:21:37
Message-ID: NEBBKFAPELEOJBLFNEMJIEPNCOAA.jason@op480.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am using php. When executing a query I do not get an error. However, when
I look at the DB it hasn't added the row and all other rows in the series of
queries have been added.

I've echo'd the $sql statement and actually ran it through the command line
with no problems.

The odd thing is, when I do these queries they do not fail, yet they do not
insert. It still increases the serial primary key ("id") so when I do a
query through the command line the first record for example would start at
12 (becuase i have tried to insert from the php code 12 times prior to
adding it manually).

Any idea on what the prob is?

Here's my sql statement:
$sql = "insert into pricing (prod_id, size_id, price) values ($prod_id,
$size_id, 0.00)";

here's an example of what it generates before it inserts:
insert into pricing (prod_id, size_id, price) values (148, 48, 0.00)

the table pricing has the following columns:
id - primar key/serial
prod_id - int4
size_id - int4
price - float4

Any help would be very much appreciated!

Thanks!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sergey E. Volkov 2001-05-24 09:39:54 Re: Return cursor
Previous Message Scott Gilbert 2001-05-24 06:43:58 RE: Connection from Win machine