Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/perl
- use strict;
- use CGI;
- use DBI;
- use CGI::Carp qw(fatalsToBrowser);
- my @row;
- my $q = CGI->new; # suzadava obek ot tip CGI
- print $q->header(); # metoda header vrushta kato text
- #my $username = $q->param("username");
- #my $password = $q->param("password");
- #my $email = $q->param("email");
- my $dbh = DBI->connect("dbi:ODBC:sql_perl", 'sa', 'sa991');
- my $sth = $dbh->prepare("SELECT * from users"); # prepare the query
- $sth->execute(); # execute the query
- @row = $sth->fetchrow_array;
- print @row;
- while (@row = $sth->fetchrow_array) { # retrieve one row
- print join(", ", @row), "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement