$dbh = DBI->connect("DBI:mysql:$database:$db_server", $user, $password); { $statement = "SELECT id,state,city,discription FROM speedtrap WHERE state=$state"; } $sth = $dbh->prepare($statement) or die "Couldn't prepare the query: ".$sth->errstr; $rv = $sth->execute or die "Couldn't execute query: ".$dbh->errstr; print <

ID

State

City

Location

Discription

EOF while (@row = $sth->fetchrow_array) { ($id,$state,$city,$Discription) = @row; print < $state $city $location $discription EOF } print ""; } $rc = $sth->finish; $rc = $dbh->disconnect;