PL/pgSQL and PHP 5

From: PostgreSQL Admin <postgres(at)productivitymedia(dot)com>
To: Lista PG-PHP <pgsql-php(at)postgresql(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: PL/pgSQL and PHP 5
Date: 2006-08-10 02:36:19
Message-ID: 44DA9BA3.2020801@productivitymedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php pgsql-sql

I'm having this problem inserting data from my form using PL/pgSQL.
Here is the simplified version of my table and function (this example
does not work, also ):

CREATE TABLE theirry.sample (
staff_id serial PRIMARY KEY NOT NULL,
firstname varchar(100),
lastname varchar(150),
username varchar(35),
identifier varchar(40),
address2 varchar(180),
activated boolean,
activated_keys varchar(32)
);

CREATE OR REPLACE FUNCTION insert_staff_b
(insert_firstname varchar)
RETURNS VOID AS
$$
DECLARE
BEGIN
INSERT INTO theirry.sample
(firstname)
VALUES
(insert_firstname);
RETURN;
END;
$$
LANGUAGE plpgsql;

I have a form with a value firstname then call the query in php

select insert_staff_b('$_POST['firstname']::varchar)

Still I get this error:
Warning: pg_query(): Query failed: ERROR: function
insert_staff_b(character varying) does not exist HINT: No function
matches the given name and argument types. You may need to add explicit
type casts.

Suggestions or maybe a place to read up on this problem.

Thanks in advance,
J

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message John DeSoi 2006-08-10 03:24:48 Re: PL/pgSQL and PHP 5
Previous Message John DeSoi 2006-08-02 18:09:13 Re: Problem with columns of type Text and Drupal/Prado/PHP5

Browse pgsql-sql by date

  From Date Subject
Next Message John DeSoi 2006-08-10 03:24:48 Re: PL/pgSQL and PHP 5
Previous Message Roman Neuhauser 2006-08-09 17:24:56 Re: Query response time