php - Comparing MD5 of a field results NULL -


I have a function to calculate that input MD5 and 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; }   

But the above questions are always the result of tap.

For example, I have a user with id = 2 and MD5 (2) is c81e728d9d4c2f636f067f89cc14862c . This is the query that arises:

SELECT id, name FROM user WHERE MD5 ( id ) = 'c81e728d9d4c2f636f067f89cc14862c' <

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:

  $ query = $ this- & gt; Db- & gt; ("Selection ID, name by name, where MD5 (id) = '$ enc'");   

Note: I removed the incorrect quote character in users and IDs around your code.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -