Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Add dbconnect_local subroutine
authorelserj <elserj@localhost>
Fri, 1 Mar 2019 21:13:23 +0000 (21:13 +0000)
committerelserj <elserj@localhost>
Fri, 1 Mar 2019 21:13:23 +0000 (21:13 +0000)
svn path=/; revision=661

interactome_scripts/DbiFloret.pm

index a4dc781e1e8469295f7e9a807b463a46a1a91576..6433273f2982a33555d71f7944c009b5cdeb950d 100755 (executable)
@@ -39,6 +39,26 @@ sub dbconnect_auto {
        
        return $dbh;
 }
+
+sub dbconnect_local {
+       my $self = @_;
+       
+       print "Username: ";
+       chomp(my $username = <STDIN>);
+       print "Password: ";
+       ReadMode('noecho');
+       chomp(my $password = <STDIN>);
+       ReadMode(0);
+       print "\nDatabase: ";
+       chomp(my $database = <STDIN>);
+       
+       my $dbh = DBI->connect("DBI:mysql:$database;host=localhost", $username, $password,
+               { RaiseError=> 1, AutoCommit=>1 }
+               ) or die "Failed to connect to database: $DBI::errstr";
+               
+       
+       return $dbh;
+}
        
 
 return 1;