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

Persistent Fault Tolerant SQL (MySQL + DBI) connections!

by expresspotato (Beadle)
on Dec 23, 2009 at 10:57 UTC ( #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
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? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2016-06-29 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (365 votes). Check out past polls.