Re: sha1 function in MySql query.
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')";
Subject
Written By
Posted
September 07, 2021 03:20PM
September 07, 2021 03:48PM
September 07, 2021 05:26PM
September 07, 2021 07:21PM
Re: sha1 function in MySql query.
September 08, 2021 01:13PM
September 08, 2021 03:45PM
September 08, 2021 04:33AM
September 08, 2021 10:29AM
September 08, 2021 12:34PM
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.