this is what one of mine looks like. <snip> use Net::MySQL; my $mysql = Net::MySQL->new( hostname => 'localhost', database => 'pixelscan', user => 'webuser', password => '3dpixelscan' ); </snip>
On Mon, Jan 27, 2003 at 02:34:53 +0530, Pankaj Kapare wrote: > Hi, > I am using Net::mysql to connect with database mysql.Though sytax is correct it is >still giving error: > > Can't locate object method "new" via package "MySql" (perhaps you forgot to load >"MySql"?) at E:\PERLTR~1\perl\VALIDA~1.PL line 10. Content-type:text/html > > My code is as follows: > > #!/usr/local/bin/perl > print "Content-type:text/html\n\n"; > use Net::MySql; > > $DBHOST = "localhost"; > $DBNAME = "SiteBuilder"; > $DBUSER = "sa"; > $DBPASS = ""; > > my $mysql=MySql->new($DBHOST, $DBNAME, $DBUSER, $DBPASS); > $mysql->query(q{SELECT sLoginId,sFirstName,sLastName FROM userdetail}); > > my $record_set = $mysql->create_record_iterator; > while (my $record = $record_set->each) { > printf "First column: %s Next column: %s\n", > $record->[0], $record->[1],$record->[2]; > } > > $mysql->close; > > I have tried other modules also like DBI,DBD but still I am getting same error.What >may be the reason .I have installed these modules through ppm .Can anybody help me? > Thanks in advance ! > Pankaj. -- Mat Harris OpenGPG Public Key ID: C37D57D9 [EMAIL PROTECTED] www.genestate.com
msg37381/pgp00000.pgp
Description: PGP signature