MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 21st, 1999, 03:39 AM
ewp
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:

HI,
WE ARE STILL ENCOUNTERING PROBLEMS WITH DBI. FOLLOWING IS THE PERL SCRIPT WE ARE USING AND ALSO THE BROWSER ERROR IS MENTIONED. PLEASE ADVISE HOW WE CAN GET PERL TO CONNECT WITH MYSQL.

Thank you for your time & effort.

Server: WinNT.

PERL SCRIPT:

print "content-type:text/htmlnn";
print "<html>";
print "<head>";
print "<title>test programme</title>";
print "</head>";
print "<body>";
use DBI;
$port = 3306;
$hostname = "localhost";
$driver = "mysql";
$database = "login";
$dsn = "DBI:$driver:database=$database;host=$hostname;port=$port";
$user = " ";
$passwd = " ";
$dbh = DBI->connect($dsn, $user, $password);
die unless $dbh;
die $dbh->errstr if $dbh->err;
print "reached 1";
my $sql = qq{SELECT id,passwd FROM test};
my $sth = $dbh->prepare( $sql );
print "reached 2";
$sth->execute();
print "reached 3";
my( $name, $id);
$sth->bind_columns( undef,$id, $name);
while ($sth->fetch())
{
print "EmpName:$name EmpNum:$id<br>";
}
die $dbh->errstr if $dbh->err;
$sth->finish();
die $sth->errstr if $sth->err;
$dbh->disconnect;
print "</body>";
print "</html>";


BROWSER ERROR:
CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did
return are:

Can't locate DBI.pm in @INC at d:inetpublinkwithindiacgi-bintestmultidb.pl line 7.
BEGIN failed--compilation aborted at d:inetpublinkwithindiacgi-bintestmultidb.pl line 7.




Rohin Sadh.
sadh@vsnl.com
ICQ # 31415379

Thsis is what our hosting co said:
----- Original Message -----
Subject: Re: mysql and DBI


Hello,
Are you using the following?
DBI server = localhost
DBI driver = mysql
Username = your domain's default user
Password = your mysql password
Please try that and let us know if works for you.
Regards,
Marnie (Support)

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > DBI MySQL cannot connect. Help !


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT