MySQL Forums
Forum List  »  Newbie

Re: sha1 function in MySql query.
Posted by: MARK LINDQUIST
Date: September 08, 2021 01:13PM

My code is all PHP meaning the queries are quoted strings. My insert statement inserts username and password into db. The results are echoed to the page. Likewise my SELECT statement selects username and password and echoes them for testing to the page.

If I use sha1 in either insert or select statements on the password field, the SELECT statement won't echo the results. The INSERT statement, even with sha, works fine.

$strLogin = "INSERT INTO t (username, password) VALUES ('$username', sha1('$password'))";

$query = "SELECT username, password FROM t WHERE username = '$user' AND password = sha1('$password')";

Options: ReplyQuote


Subject
Written By
Posted
September 07, 2021 03:20PM
Re: sha1 function in MySql query.
September 08, 2021 01:13PM
September 08, 2021 04:33AM


Sorry, you can't reply to this topic. It has been closed.

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.