I am accessing a mysql database through perl, and seeing if the ftp given is equal to any of the ftp's in the database. does this look correct?

$sth = $dbh->prepare( "SELECT * from ftp where ftp='$ftp'" );
if( !$sth->execute ) {
die "....";
}
if( $sth->rows ) {
#Error--FTP is already in database

}