List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:August 22 1999 3:16pm
Subject:Re: question about connecting with
View as plain text  
Jay Chou wrote:
> My Internet Hosting company does not provide DBI module support, so I have to use
>, when I try the following, all just get a blank screen. Could use some help,
> thanks in advance
> #!/usr/local/bin/perl
> use Mysql;
> print "Content-type: text/html\n";
> $passed = $ENV{'QUERY_STRING'};
> $host = "";
> $database = "k20";
> $user = "k20";
> $password = "mfp";
> $dbh = Mysql->connect($host, $database, $user, $password);
> $out = $dbh->query("select * from Product");
> print " query is $passed\n";

To get better help on this list, change your hosting company to the one
that supports DBI :-) Most of us do not use the Mysql module and would
have to look up the documentation to answer your questions, which is
just as easy for you do to yourself.

There is a trend in your code, however, that is likely to cause
problems. You never check for errors, so if something goes wrong you
will never know what happened. A good coding principle is to follow each
call that could have generated an error with an error check and a
message that an error has happened.

If you suspect that a certain call will abort your program in case of an
error and that it actually happens, print a debugging message before and
after each suspicious call - this will help you track down the offender.

Sasha Pachev
question about connecting with Chou)21 Aug
  • Re: question about connecting with mysql.pmSasha Pachev22 Aug
  • RE: question about connecting with mysql.pmDan Ray23 Aug