in reply to Mysql select and store one field

my ($post) = $dbh->selectrow_array("SELECT post FROM tablename WHERE u +rl=?", {}, $url);
Uses placeholders to prevent SQL injection but I would still validate the $url if it's comming from outside the script.
This assumes you are only expecting one row to be returned.