PL/pgSQL and PHP 5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux