$sth = $db->prepare("SELECT the_name FROM the_table WHERE id=?"); $sth->execute(3); my ($the_name) = $sth->fetchrow_array;