http://qs321.pair.com?node_id=309483


in reply to selecting from a mysqldatabase

Some things to consider:

Here is an (untested) rewrite of your code.

Make sure you understand what is there. See our Tutorials page for more basics on database programming with Perl.

my @compile=param ('compile'); my $version = "whatever"; my $dbh=DBI->connect($dsn,$user,$password,) or die "Error $DBI::errstr connecting to $dsn"; my $sth=$dbh->prepare(qq{ SELECT mycolumn FROM ddts WHERE `Stat`= ? AND `Project`= ? AND `Version`= ? }); $sth->execute("T", "Def", $version); print "<table border=2>"; while (my ($identifier) = $sth->fetchrow_array ) { foreach my $elem (@compile) { if ($elem eq $identifier) { print "<tr><td>$identifier</td></tr>"; } } } print "</table>";
 _  _ _  _  
(_|| | |(_|><
 _|