PL/pgSQL and PHP 5 - Mailing list pgsql-php

From PostgreSQL Admin
Subject PL/pgSQL and PHP 5
Date
Msg-id 44DA9BA3.2020801@productivitymedia.com
Whole thread Raw
Responses Re: PL/pgSQL and PHP 5
Re: [SQL] PL/pgSQL and PHP 5
List pgsql-php
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

pgsql-php by date:

Previous
From: John DeSoi
Date:
Subject: Re: Problem with columns of type Text and Drupal/Prado/PHP5
Next
From: John DeSoi
Date:
Subject: Re: PL/pgSQL and PHP 5