php - Comparing MD5 of a field results NULL -
I have a function to calculate that input MD5 and But the above questions are always the result of tap. For example, I have a user with The query is working alone to be expected. Check this SQLFiddle: However, there seems to be a problem with the following line, try to correct it: Note: I removed the incorrect quote character in users and IDs around your code. id, name
Verify the public function user ($ enq) {// resonance $ ang; $ Query = $ this- & gt; Db- & gt; Ready ("SELECT id, name by name 'user where MD5 (` id`) =' $ enc '"); // $ query- & gt; BindValue (1, $ ENC); $ Query-> Executed (); $ Data = $ query- & gt; Fetch (); // var_dump ($ query); $ Return data; }
id = 2 and
MD5 (2) is
c81e728d9d4c2f636f067f89cc14862c . This is the query that arises:
SELECT id, name FROM user
WHERE MD5 ( id
) = 'c81e728d9d4c2f636f067f89cc14862c' <
$ query = $ this- & gt; Db- & gt; ("Selection ID, name by name, where MD5 (id) = '$ enc'");
Comments
Post a Comment