Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9266077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:14:05+00:00 2026-06-18T14:14:05+00:00

I am trying to integrate phpass library with an existing authenticate method: public static

  • 0

I am trying to integrate phpass library with an existing authenticate method:

public static function authenticate($username, $password)
{
    global $db;
    $username = $db->prep_query($username);
    $password = $db->prep_query($password); // Does not seems like it will be used

    # First step: Retrieve the account based on the user input (email)
    $query_string = "SELECT * FROM users WHERE email = '{$username}' LIMIT 1";
    $query_result = static::find_by_query_string($query_string);

    return !empty($query_result) ? array_shift($query_result) : false;
}

Now the record that comes back is ( according to print_r($query_result) )

Array ( [0] => User Object ( [id] => 7 [password] => $2a$08$qwSjSZ11TUYs5w1L89ppFer2n40HrnjlvaQ00DsUOOvjSYwoEmN4K [email] => test@user.com ) ) 1

What I’m trying to retrieve is: "$2a$08$qwSjSZ11TUYs5w1L89ppFer2n40HrnjlvaQ00DsUOOvjSYwoEmN4K"

But when I use $query_result[0][1] or $query_result[0]["password] I’m getting an error.

What am I missing here? How can I use the password value in $query_string array ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:14:06+00:00Added an answer on June 18, 2026 at 2:14 pm

    You access the first array index, which happens to be an object. So you then need to access the property called password.

    $query_result[0]->password
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to integrate Paypal's MECL in an already existing IOS project
I'm trying to integrate ckeditor with a spring mvc project and it does not
I am trying to integrate refinerycms with my existing rails app and i want
I am trying to integrate the jQuery Masonry library with my GWT project. However
I am trying to integrate a few non-wordpress PHP pages into an existing Wordpress
Trying to integrate some friendly_id gem functionality on a controller method. Essentially, I have
Im trying to integrate Brad Larson's GPUImage framework to my project. The sample code
I'm trying to integrate Video4Linux in my managed application. Indeed I've declared all required
I'm trying to integrate passport into my nodejs server using connect, but can't seem
Hi I'm trying to integrate MySpace with my Android app. As I'm new to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.