problem with connection to mysql

Discussion in 'Classic ASP' started by payalc, Sep 2, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. hello,
    i want to access data from mysql database using cgi-perl script.but when i run html form it gives me error "internal server error"
    here is html file
    <html>
    <form action="http://www.dentalcollegesangli.org/cgi-bin/student.pl", method="post" >
    <input type="text" name="name" value=" " >
    <input type="submit" value="submit">
    </form></body></html>
    & this is CGI-Perl script.
    #!/usr/bin/perl
    print "Content-type: text/html\n\n";
    use CGI qw :)standard);
    use DBI;
    $cgi=new CGI;
    $drh = DBI->install_driver("mysql");
    print $cgi->header;
    $n=$cgi->param('name');
    print "<html>";
    $con=DBI->connect("DBI:mysql:dentalcollegesangli:http://203.199.107.224","user","user123")||die "DBI->connect: $DBI::errstr ";
    $q=$con->prepare("select * from merit where roll_no='$n'");
    $q->execute();
    while(@r=$q->fetchrow_array())
    {
    if($r[0] eq "")
    {
    print "sorry not in merit list</b>";
    }
    else
    {
    print "Roll_no=$r[0]
    ";
    print "Merit No=$r
    ";
    print "Name=$r
    ";
    pritn "Total Marks=$r
    ";
    }
    }
    print"(/body></html>";
    what is the problem.
    if anybody have an idea help me
    thank u in advance.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Did you disable friendly error in your browser? 500 error is one of those error that can be caused by multiple things

    See http://kb.discountasp.net/article.aspx?id=10052

    Posting the error message after you disable friendly error.

    quote:Originally posted by payalc

    hello,
    i want to access data from mysql database using cgi-perl script.but when i run html form it gives me error "internal server error"
    here is html file
    <html>
    <form action="http://www.dentalcollegesangli.org/cgi-bin/student.pl", method="post" >
    <input type="text" name="name" value=" " >
    <input type="submit" value="submit">
    </form></body></html>
    & this is CGI-Perl script.
    #!/usr/bin/perl
    print "Content-type: text/html\n\n";
    use CGI qw :)standard);
    use DBI;
    $cgi=new CGI;
    $drh = DBI->install_driver("mysql");
    print $cgi->header;
    $n=$cgi->param('name');
    print "<html>";
    $con=DBI->connect("DBI:mysql:dentalcollegesangli:http://203.199.107.224","user","user123")||die "DBI->connect: $DBI::errstr ";
    $q=$con->prepare("select * from merit where roll_no='$n'");
    $q->execute();
    while(@r=$q->fetchrow_array())
    {
    if($r[0] eq "")
    {
    print "sorry not in merit list</b>";
    }
    else
    {
    print "Roll_no=$r[0]
    ";
    print "Merit No=$r
    ";
    print "Name=$r
    ";
    pritn "Total Marks=$r
    ";
    }
    }
    print"(/body></html>";
    what is the problem.
    if anybody have an idea help me
    thank u in advance.

    </blockquote id="quote"></font id="quote">

    B.

    DiscountASP.NET
    http://www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page