Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: DBI->connect using 'old-style' syntax is deprecated and will be an error in future versions

by DigitalKitty (Parson)
on Jul 16, 2003 at 01:05 UTC ( [id://274649]=note: print w/replies, xml ) Need Help??


in reply to DBI->connect using 'old-style' syntax is deprecated and will be an error in future versions

Hi LameNerd.

The syntax you tried to use has changed. I took the liberty of including a small, simple, (and tested) code sample ( ActiveState 5.8.0, DBI version 1.37, MySQL 4.0.1).

#!/usr/bin/perl -w use strict; use DBI; my $DSN = "DBI:mysql:database=testDB"; my $dbh = DBI->connect( $DSN, "xxx", "xxx" ) or die "$DBI::errstr"; my $sth = $dbh->prepare("select * from teams"); $sth->execute(); while( my $ref = $sth->fetchrow_hashref() ) { print "$ref->{'wins'} $ref->{'losses'}"; } $sth->finish(); $dbh->disconnect();


In case you're interested, here are some resources:

Title:Programming the Perl DBI
ISBN:1565926994
List Price:$34.95

Title:Mysql and Perl for the Web
ISBN:0735710546
List Price:$44.99

Title:MySQL, Second Edition
ISBN:0735712123
List Price:$49.99

http://www.perl.com/lpt/a/1999/10/DBI.html
http://www.devshed.com/Server_Side/Perl/Carping/print_html
http://www.eskimo.com/~ericj/personal/postgresql/sql1.htm
http://www.eskimo.com/~ericj/personal/postgresql/sql2.htm
http://www.eskimo.com/~ericj/personal/postgresql/sql3.htm

Hope these help,

If you have any more questions, don't hesitate to ask.

Thanks,
-Katie

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://274649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-03-29 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found