#!C:/Perl64/bin/perl.exe use DBI; use CGI; $cgi = new CGI; ##Create table using cgi $dbh = DBI->connect("dbi:mysql:TestDB", 'root','zulfi12345') or die "Unable to connect: $DBI::errstr\n"; $username = $cgi->param( 'username' ) || ''; $password = $cgi->param ('password') || ''; $submit = $cgi->param( 'submit' ) || ''; $sth = $dbh->prepare("SELECT username, password FROM users WHERE username =$username and password=$password"); $sth->execute(); $found=0; while($row = $sth->fetchrow_hashref) { $found=1; } if ($found==1){ print "Welcome";}