MySQL Forums
Forum List  »  PHP

Mysql Query with field name and custom value to compare
Posted by: Rohit Seth
Date: December 10, 2020 01:55PM

We have a users table with Username and extra1 fields.
We want to pass a custom value like
$customvalue=123456;
and added to a field extra1 whose value can be anything like
extra1 = abc123
and compare its sha1 output with a seperate variable.

We tried this query but it is not working, it is not fetching the value of extra1 field so not been able to get used properly.

select Username,extra1 from users where sha1(extra1.$customvalue)='$hash'

Options: ReplyQuote


Subject
Written By
Posted
Mysql Query with field name and custom value to compare
December 10, 2020 01:55PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.