koha-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-devel] Use of "my $dbh=C4Connect;"


From: Larry Currie
Subject: [Koha-devel] Use of "my $dbh=C4Connect;"
Date: Tue Mar 25 13:56:04 2003

We're developing a script to load data for the biblio, biblioitems, and
items tables of the koha MySQL database using DBI and we're wondering
what to use for our database handle.  I can see that in a number of the
koha scripts the command

my $dbh=C4Connect;

is used to establish the connection to the koha database and that the
command lines

use C4::Database;          and
use C4::Input;

are inserted at the top of the scripts.

The DBI documentation, however, instructs you to use the following
database handle command:

my $dbh = DBI->connect("dbi:DriverName:db_name", $user, $password)
   or die "Can't connect to $data_source: $DBI::errstr";

Can someone help us to reconcile these two methods or instruct us on how
we should be connecting to the koha database to perform our INSERT
commands?

Thanks.

Larry Currie

--
Lawrence W. Currie
User Services Librarian
California Academy of Sciences
Golden Gate Park
San Francisco, CA 94118
address@hidden
(415) 750-7108
(415) 750-7106 fax
http://www.calacademy.org/research/library/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]