connection to mysql on linux(apache)web server

Discussion in 'Databases' 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 do access data from mysql 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.
     
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