Hi to all
I have some problem to use DBIx::Class
[CODE=perl]package My::Schema;
use base qw/DBIx::Class::Sc hema::Loader/;
__PACKAGE__->loader_options (
debug => 1,
);
__PACKAGE__->connection('db i:mysql:music:l ocalhost','root ','');
1;
[/CODE]
I have set my DBIx::Class using the above code and i have a perl script to get some value from albuminfo table .It is my testing stage only so please help on this. my perl script
[CODE=perl]#!/usr/bin/perl
use My::Schema;
my $schema = My::Schema->connect("dbi:m ysql:music:loca lhost", "root", "");
my $album = $schema->resultset('alb uminfo')->find(14);
if ($album) {
print "Found ", $album->title, ", The ID = ", $album->albumid, "n";
} else {
print "Can't find album.n";
}
[/CODE]
But it gives some error
The Error
Regards
Rajiv
I have some problem to use DBIx::Class
[CODE=perl]package My::Schema;
use base qw/DBIx::Class::Sc hema::Loader/;
__PACKAGE__->loader_options (
debug => 1,
);
__PACKAGE__->connection('db i:mysql:music:l ocalhost','root ','');
1;
[/CODE]
I have set my DBIx::Class using the above code and i have a perl script to get some value from albuminfo table .It is my testing stage only so please help on this. my perl script
[CODE=perl]#!/usr/bin/perl
use My::Schema;
my $schema = My::Schema->connect("dbi:m ysql:music:loca lhost", "root", "");
my $album = $schema->resultset('alb uminfo')->find(14);
if ($album) {
print "Found ", $album->title, ", The ID = ", $album->albumid, "n";
} else {
print "Can't find album.n";
}
[/CODE]
But it gives some error
The Error
Code:
Base class package "DBIx::Class::Schema::Loader" is empty.
(Perhaps you need to 'use' the module which defines that package first.)
at C:/Perl/lib/My/Schema.pm line 2
BEGIN failed--compilation aborted at C:/Perl/lib/My/Schema.pm line 2.
Compilation failed in require at C:\DOCUME~1\INDIAM~1.COM\LOCALS~1\Temp\loc546.tmp line 2.
BEGIN failed--compilation aborted at C:\DOCUME~1\INDIAM~1.COM\LOCALS~1\Temp\loc546.tmp line 2.
Regards
Rajiv
Comment