Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: $data{"str$i"} not valid in mysql select?

by Anonymous Monk
on Nov 27, 2013 at 06:48 UTC ( [id://1064558]=note: print w/replies, xml ) Need Help??


in reply to $data{"str$i"} not valid in mysql select?

May I recommend using prepared queries?
$store = qq-INSERT INTO main (creator_name,relationship) VALUES(?, ?)- +; my $sth = $dbh->prepare($store); for my $i (0..3) { $sth->execute($data{creatorname}, $data{"relationship$i"}); # or a nicer syntax using a hash slice: # $sth->execute( @data{ "creatorname", "relationship$i" } ); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-19 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found