I have created a function in postgresql
CREATE OR REPLACE FUNCTION public.insert_vpn_masteraccount(varchar, varchar, varchar, varchar, varchar, varchar, varchar, varchar, varchar)
RETURNS varchar AS
'
DECLARE
BEGIN
insert into masteraccount(fname,midint,lname,username,atype) values($1,$2,$3,$4,$5);
insert into passwd(u_id,currentpwd) values((select max(u_id) from masteraccount where username=$4),$6);
insert into ipinfo(u_id,ipaddress,atype) values((select max(u_id) from masteraccount where username=$4),$7,$5);
insert into userinfo(u_id,agency,user_email) values((select max(u_id) from masteraccount where username=$4),$8,$9);
return masteraccount.u_id where masteraccount.username=$4;
END;
'
LANGUAGE 'plpgsql' VOLATILE;
I can insert data using this function with a sql statement by typing
select insert_vpn_masteraccount(‘tom’,’d’,’johnson’,’tomd.johnson’,’V’,’1234’,’DHCP’,’AGR’,’idontcare@care.com’
this works fine
but when I try to do it from a php web page using
$enter = $db_object->query("SELECT insert_vpn_masteraccount('$fname','$mi','$lname','$acc_type','$passwd','$ip','$agency','$contact')");
This does not work
Can anyone help me?
Thanks
Robert Stewart
Network Eng
Commonwealth Office of Technology
Finance and Administration Cabinet
101 Cold Harbor
Work # 502 564 9696
Cell # 502 330 5991
Email RobertD.Stewart@ky.gov