Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: MySQL and Perl - Shorthand

by broquaint (Abbot)
on Sep 21, 2002 at 13:06 UTC ( [id://199744]=note: print w/replies, xml ) Need Help??


in reply to Re: MySQL and Perl - Shorthand
in thread MySQL and Perl - Shorthand

This
$sth = $db->prepare("SELECT the_name FROM the_table WHERE id=?"); $sth->execute(3); my ($the_name) = $sth->fetchrow_array;
Can be converted into this
my ($the_name) = $dbh->selectrow_array(<<SQL, undef, 3); SELECT the_name FROM the_table WHERE id = ? SQL
Although it always feels a little weird using selectrow_array for a single value. But I guess that's what abstraction layers are for :)
HTH

_________
broquaint

Log In?
Username:
Password:

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

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

    No recent polls found