By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,957 Members | 2,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,957 IT Pros & Developers. It's quick & easy.

Using Postgresql Function via PHP

P: 1
Hi...

I'm having trouble with my postgresql function and i'm using php script to access the function. I want to insert data into a table that consists of 25 columns through the function. But i only have two columns/fields in my php script that will insert into the table and the rest columns/fields are inserted through the function itself (inserted from the value of another tables).

Here is my pgsql function : (see attachment plankandua.sql in ricky.zip)

The two fields/columns that inserted into the work_planned table which i mentioned above is order_no and sub_itemno. And the rest fields/columns is inserted from another tables by calling and storing them in the function.

And here is my php code : (see attachment inscust.php and insert.php in ricky.zip)

When i press the submit button in inscust.php, it returned an error :
" ERROR: syntax error at or near "VALUES" LINE 1: SELECT plankandua (order_no, item_no) VALUES ('1-2010-117','... ^ SELECT plankandua (order_no, item_no) VALUES ('1-2010-117','2.2') "

Thanks for any help. If you any information or any data, please let me know.

Ricky
Attached Files
File Type: zip ricky.zip (9.7 KB, 27 views)
Mar 8 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.