how can i perform a hlookup in sql table?

Copper Contributor

Hi, 

I have a user table in SQL containing user details along with 5 Security questions and answers which were filled by them at the time of registration.

 

Again at the time of login they have to answer 3 questions which are displayed in a random order.

 

To achieve this I have created another table with a column of questions and applied "ORDER BY RAND() LIMIT 1"

 

But now the challenge for me is how can Search and Match the Question and Answer for a Specific user?

 

Note: The order appearance of questions is not same for Registration and Login. I meant the order of questions is same for all the users who want to register, but not same for login(Like the question no 1 at the time of registration, may appear in question no 3 at the time of Login).

 

That the reason I want to search the Question and Answer from and match them from a single row?

 

Please Help,

            How can I achieve this?

Some screenshots are attached for reference.

0 Replies