I use something like this

sub provera_korisnika     #Proveravam korisnicko ime i lozinku
{ $ime = $user->get_text; #this method get text from entry
   $lozinka = $pass->get_text; #this to

   $dbh = DBI->connect(
                                       "DBI:mysql:evidencija",
                                        'root', '', {
                                       RaiseError =>1,
                                       AutoCommit =>0 }
) || die "Database connection not made: $DBI::errstr";; my $sql = qq{ SELECT user, pass FROM login };
   my $sth = $dbh->prepare( $sql );
   $sth->execute();

   my( $user, $pass );
   $sth->bind_columns( undef, \$user, \$pass );

   while( $sth->fetch() )
{ foreach($user)
       {
           if( $user eq $ime)
           {
           print "$user, $ime\n"; #what if OK
           }
           else { Gtk2->main_quit; } #what if wrong
       }
} }

I want if user corect do something, if not do something



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to