Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: How to get input text boxes populated

by poj (Priest)
on Jul 07, 2014 at 11:51 UTC ( #1092560=note: print w/ replies, xml ) Need Help??


in reply to Re^3: How to get input text boxes populated
in thread How to get input text boxes populated

Use placeholders (?) in your sql and extract the data from the parameters.

if ( ($action eq "UPDATE") && ($empid =~ /\d+/)) { my @data=(); my @fields = qw!lastname firstname title toc dob doh address city region pcode country homephone ext notes repto!; for my $f (@fields)[ push @data,$q->param($f) || '' ; } push @data,$empid; my $sql = qq!UPDATE "Employees" SET "LastName" = ?, "FirstName" = ?, "Title" = ?, "TitleOfCourtesy" = ?, "BirthDate" = ?, "HireDate" = ?, "Address" = ?, "City" = ?, "Region" = ?, "PostalCode" = ?, "Country" = ?, "HomePhone" = ?, "Extension" = ?, "Notes" = ?, "ReportsTo" = ? WHERE "EmployeeID" = ? !; my $count = $dbh->do( $sql,undef,@data); $msg = "$count Record updated - $sql, @data"; } else { $msg = "Please complete form"; }
poj


Comment on Re^4: How to get input text boxes populated
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1092560]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2015-07-29 01:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls