use DBI; use strict; $a=; chomp $a; $b=; chomp $b; my $dbname="test"; my $dbh=DBI->connect("DBI:mysql:$dbname","root","", {RaiseError=>1, AutoCommit=>0}); $sth=$dbh->do("create table rec(name varchar(10), id int(10)"); $sth=$dbh->prepare("insert into rec(name, id) values(?, ?)"); $sth->execute($a, $b); $sth->prepare("select * from rec"); my @row; while (@row=$sth->fetchrow_array) { print "@row\n"; } $sth->finish(); $dbh->disconnect(); exit;