##
select system.id from user, system
where user.id = system.userid and user.name = ?
####
select user.name from user, system
where user.id = system.userid and system.id = ?
####
my $sth = $dbh->prepare( "select ..." ); # sql with "?" in there somewhere
$sth->execute( $param ); # pass a value from cgi params
my $rows = $sth->fetchall_arrayref;
if ( ref( $rows ) eq 'ARRAY' and @$rows ) {
print "";
print "User System \n";
for my $row ( @$rows ) {
print "" . join( " ", @$row ) . " \n";
}
print "
\n";
}
else {
print "No matches found.
";
}