|
Last change
on this file since 352 was
8,
checked in by g7moreau, 14 years ago
|
- Move biblehal folder in subfolder of trakata
|
-
Property svn:executable set to
*
|
|
File size:
599 bytes
|
| Rev | Line | |
|---|
| [2] | 1 | #!/usr/bin/perl |
|---|
| 2 | # |
|---|
| 3 | # gabriel 2010/06/03 |
|---|
| 4 | |
|---|
| 5 | # apt-get install libdbd-mysql-perl |
|---|
| 6 | |
|---|
| 7 | use strict; |
|---|
| 8 | |
|---|
| 9 | use DBI; |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | my $config_file = '/srv/refbase/initialize/db.inc.php'; |
|---|
| 13 | my $connect_name = qx{ grep '\$username =' $config_file | cut -f 2 -d '"' }; |
|---|
| 14 | my $connect_pass = qx{ grep '\$password =' $config_file | cut -f 2 -d '"' }; |
|---|
| 15 | chomp($connect_name, $connect_pass); |
|---|
| 16 | |
|---|
| [7] | 17 | my $dbh = DBI->connect( "DBI:mysql:database=refbaselegi;host=localhost", |
|---|
| 18 | "$connect_name", "$connect_pass", { 'RaiseError' => 1 } ); # refbase server |
|---|
| [2] | 19 | |
|---|
| 20 | my $sth = $dbh->prepare("SELECT serial FROM refs"); |
|---|
| 21 | $sth->execute(); |
|---|
| 22 | |
|---|
| 23 | print $sth->rows."\n"; |
|---|
Note: See
TracBrowser
for help on using the repository browser.