source: trunk/biblehal/biblehal-count @ 300

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