my $statement = $dbh->prepare( "SELECT Questions, ID from QA;" ); $statement->execute(); my ($question, $id); $statement->bind_columns( \$question, \$id ); print "
##
my $id = $cgi->param( 'id' );
my $statement = $dbh->prepare( qq`SELECT Questions, Answers from QA where ID = "$id";` );
$statement->execute();
my ($question, $answer);
$statement->bind_columns( \$question, \$answer );
while ($statement->fetch) {
print qq`
$question
$answer
`
}