Leser: 3
![]() |
|< 1 2 3 4 >| | ![]() |
31 Einträge, 4 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/perl use strict; use DBI; # Connect to the database. my $dbh = DBI->connect("dbi:mysqlPP:database=cdcol;host=localhost", "USER", "PW", {'RaiseError' => 1}); # Now retrieve data from the table. my $sth = $dbh->prepare("SELECT id, title FROM cdcol"); $sth->execute(); while (my $ref = $sth->fetchrow_arrayref()) { print "Found a row: id = $ref->[0], name = $ref->[1]\n"; } $sth->finish(); # Disconnect from the database. $dbh->disconnect();
1
2
3
C:\xampplite\perl\eg>perl mysql.pl
DBD::mysqlPP::st execute failed: #08S01Bad handshake at mysql.pl line 13.
DBD::mysqlPP::st execute failed: #08S01Bad handshake at mysql.pl line 13.
1
2
3
4
5
6
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains:
C:/xampplite/perl/site/lib C:/xampplite/perl/lib .) at (eval 4) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge, mysqlPP.
at mysql.pl line 7
Struppi+2008-03-25 16:39:01--er hat aber den Ordner der xampp installation verwendet, das ist legitim.
![]() |
|< 1 2 3 4 >| | ![]() |
31 Einträge, 4 Seiten |