From: "Hillensbeck, Preston" <PHillensbeck(at)sfbcic(dot)com>
To: "'pgsql-php(at)postgresql(dot)org'" <pgsql-php(at)postgresql(dot)org>
Subject:
Date: 2002-04-17 21:03:21
Message-ID: 040AE3A029B3D51181D000508BC75D0201387762@MERCURY
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

I am currently experiencing a problem passing data from a PHP page to
PostgreSQL.

I am passing different data types like numeric, and text. Let me show you
some of the code I am using....

This is the code that I am using to pass the input data to a page called
"checkbook2.php"

<form action="checkbook2.php" method="GET">
<p align="center">Check Date
<input type="text" name="check_date" VALUE="">
Check Number
<input type="text" name="check_number" VALUE="">
Check Payee
<input type="text" name="check_payee" VALUE="">
Check Amount
<input type="text" name="check_amount" VALUE="">
</p>
<p align="center">Check Transaction Type
<input type="text" name="check_trans_type" VALUE="">
</p>
<input type=submit value="Add New Entry">
</form>

This is the data from the checkbook2.php that talks to the PostgreSQL
Server. It is running version 7.2.

$conn=pg_connect("host=192.168.0.2 user=postgres password=postgres
dbname=checkbook");

@$sql="INSERT INTO checking VALUES('$check_date', '$check_num',
'$check_pay', '$check_amount', '$check_trans_type');";

$result=pg_exec($conn, $sql);

check_data is type text
check_num is type int4
check_pay is type text
check_amount is type numeric(8,2)
check_trans_type is type text

The error that comes up is ...
Warning: PostgreSQL query failed: ERROR: Bad numeric input format
'check_trans_type' in /etc/httpd/htdocs/checkbook2.php on line 41

Anyone know what could be going on here?? Please let me know, thanks in
advance! :)

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Cornelia Boenigk 2002-04-17 21:18:34 Re:
Previous Message Josh Berkus 2002-04-17 17:35:59 Re: PERFORMANCE