in reply to accessing values in hash

You didn't provide enough information for anyone to give you any meaningful assistance.

Obviously, check to see if everything is defined and the database request didn't return an error (such as "item not found").

emc

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

Albert Einstein

Replies are listed 'Best First'.
Re^2: accessing values in hash
by mattdope (Acolyte) on Sep 03, 2006 at 23:33 UTC
    hi there, there is no problem accessing the database. I am using;
    $sth = $dbh->prepare("select username, password from reg"); $sth->execute;
    and then the previous code I have posted to fetch and display it. But I need to print out whether the username i have it $testUsername matches one of the usernames returned from the database

      Sorry, I posted before you posted your answer.

      emc

      Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

      Albert Einstein
        sorry I have never came across grep. You mean I should be looking to do something like:
        $sth = $dbh->prepare(q{select username, password from reg where username = ?}); $sth->execute($testUsername);