source: trunk/biblehal-count @ 6

Last change on this file since 6 was 2, checked in by g7moreau, 13 years ago
  • Initial script import
  • Change script name
  • Change script path
  • Must be bogus !
  • Property svn:executable set to *
File size: 580 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=servref",
18   "$connect_name", "$connect_pass", { 'RaiseError' => 1 } );
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.