Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 romping around the Monastery: (7)
As of 2014-09-22 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (179 votes), past polls