$sth = $dbh->prepare($sql);
$sth->execute();
$sth->{NAME};
But how do you do that when:
$hr = $dbh->selectall_hashref($sql,'pk_id');
There’s no $sth, so how do you get the $sth->{NAME}? $dbh->{NAME} doesn’t exist.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you’re looking at a row, you can always use
keys %$rowto find out what columns it contains. They’ll be exactly the same thing asNAME(unless you changeFetchHashKeyNametoNAME_lcorNAME_uc).