- #!/opt/lampp/bin/perl
- print "Content-type: text/html;charset=windows1251\n\n";
- use DBI;
- $host = 'localhost';
- $database = 'bb303';
- $user = 'root';
- $password = '';
- $dbh = DBI->connect("DBI:mysql:database=$database;host=$host",
- $user, $password) || die print "Can't connect";
- $sth = $dbh->prepare(q{SELECT `id` , `message` FROM `flud` });
- $sth->execute;
- while ( ($id,$message)= $sth->fetchrow_array())
- {
- print "$message<br>";
- }
- $sth->finish();