Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Persistent Fault Tolerant SQL (MySQL + DBI) connections!

by expresspotato (Beadle)
on Dec 23, 2009 at 10:57 UTC ( [id://814072]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @results = &row_sql(qq~ select * from table where ...; ~);
    
    ...
    foreach my $row (@$rows){
      print "$row->{id}, $row->{somecolumn}\n";
    }
    
  2. or download this
        until (
        $dbh=DBI->connect_cached($connectionInfo,$user,$passwd, {PrintErro
    +r=>0} )
    ...
            }
        }
        ) { if ($sqlw){print "Retrying SQL Insert ($DBI::errstr)...";} sle
    +ep (1); $retry_count++;}
    
  3. or download this
    
    use DBI;
    ...
        
        return 1;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://814072]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-04-20 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found