[- use Msql; use CGI qw(:standard); $dbh = Msql->connect; $dbh->selectdb("sharks"); %age = ( '0' => 'Young', '1' => 'Adult', '2' => 'Old' ); # We now start to build the query. When finished, a typical query # will look something like this: # SELECT * FROM SHARK WHERE SPECIES='Isurus Paucus' AND AGE=2 $query = "select * from sharks where "; if ($species or $age or $location) { $query .= " where "; $query .= join(" and ", param); } $result = $dbh->query($query); if (result == -1) { echo("Error : " . Msql->errmsg . "\n"); exit(1); } $numresults = $result->numrows; -]