David,
Thanks,
Now I am getting the following:
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC contains; C:/Perl/lib
C:/Perlsite/lib .) at (eval 1)
line 3;
I can't mysql.pm on my PC. Was it not generated when I installed MySQL? How do I fix
this?
Thanks,
Jerry
David Lloyd wrote:
> Gerald,
>
> > #!perl
> >
> > use strict;
> > use DBI();
> >
> > # Connect to the database.
> > my $dbh = DBI->connect("DBI:mysql:database=club;host=localhost",
> > "jwp", "xxxxx",
> > {'RaiseError' => 1});
> >
> > $drh = DBI->install_driver("\mysql");
> >
> > I am not sure what is wrong.
> >
> > I get the following error:
> >
> > "Global sysmbol "$drh" requires explicit package name at dbtest.pl line 12"
>
> That's a Perl error.
>
> You've told Perl not to allow you to use a variable unless you declare
> it with:
>
> my
> local
> our
> (and possibly other keywords but these are the most common)
>
> If you substitute:
>
> my $drh=....
>
> ...then you'll be fine.
>
> You might want to find out more information on what the "use strict"
> actually does too. A good place would be the perl documentation
> (perldoc) or http://www.perl.org/
>
> Hope this helps.
>
> DSL
>
> [mysql,query]
> --
> I reniad lin ne mor, nuithannen
> In gwidh ristennin, i fae narchannen
> I lach Anor ed ardhon gwannen
> (Soundtrack LOTR)
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php