Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: array from query to db

by Juerd (Abbot)
on Dec 13, 2005 at 09:30 UTC ( [id://516263]=note: print w/replies, xml ) Need Help??


in reply to array from query to db

(Hey, that looks like a nice node for posting a plugging reply. Let's click it and see. Hm, indeed, it's suitable for a shameless DBIx::Simple plug.)

Consider using my module DBIx::Simple, which would allow you to simply write:

use DBIx::Simple; my $dsn = "dbi:mysql:host=$host;database=$dbname"; my $db = DBIx::Simple->connect($dsn, $user, $pass); my @ip = $db->query('SELECT ip FROM mal_switch')->flat;

In any case, please don't use the deprecated Mysql module, but something that is more generic. In addition, please indent according to syntax, not semantics. It's cute, but not easy to read or maintain.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found