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 8616647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:40:14+00:00 2026-06-12T05:40:14+00:00

Suppose I have a database table consisting of three columns – Userid, Username &

  • 0

Suppose I have a database table consisting of three columns – Userid, Username & Password. And let’s assume I am building a Log-in Form and the password is stored in encrypted form. So, before it can be compared with the original password, it needs to be processed a little.

So, I let the user enter the username and password in the form.

include('db.php');      
$getuid = $connection->prepare('SELECT FROM users WHERE username = :u');
$getuid->execute(array("u" => $_REQUEST['username']));

Now, I have executed the statement, and the row with the Entered Username is selected.

What I Want to Do ?

After Selecting the Row, I want the corresponding Password(which is in encrypted form) and Userid to be stored in $pass, $userid variables. How can I do that?

  • 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-12T05:40:15+00:00Added an answer on June 12, 2026 at 5:40 am

    the select query needs to be $getuid = $connection->prepare('SELECT * FROM users WHERE username = :u'); where * selects/gets all columns from the table users.

    Then traverse the results, as per their column names (username, and say pwd) to get their corresponding values, as shown below:

        $results = $stmt->fetch(PDO::FETCH_ASSOC);
        foreach ( $results as $v) {
         $username = $v['username'];
         $pwd = $v['pwd']; 
         }
    

    Note: you cannot retrieve the original or decoded password, its explained nicely here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's suppose I have a the following simplified example database consisting of three tables:
Suppose I have a database table with columns a, b, and c. I plan
Suppose we have a PostgreSQL database with two tables A, B. table A columns:
Let's suppose I have a table in my database with 1.000.000 records. If I
Suppose I have an array that mimics a database table. Each array element represents
Suppose I have an Orders table in my database and a corresponding model class
Suppose I have an Oracle 11.2 database containing the following table: TABLE: SURVEY PARAMETER
Suppose I am building an app using current mysql database tables. I have this
Suppose I have 2 tables in a database. eg: Dog & Boss This is
Suppose I have database table TABLE1 and there is Column COLUMN1 . The variable

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.