note 80414 deleted from function.md5 by peehaa
| From: | peehaa@php.net | Date: | Sun, 28 Apr 2019 10:52:52 +0000 |
| Subject: | note 80414 deleted from function.md5 by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210830@lists.php.net to get a copy of this message | ||
Note Submitter: admin at gadelkareem dot com
----
MySQL MD() will not give you the same hash if character set is different.
ex :
<?php
#suppose table_name CHARSET=UTF8
#$md5 = md5('Städte'); # will give you a different hash than MySQL MD5()
#instead use
$md5 = md5(utf8_encode('Städte'));
$r = mysql_query("SELECT *, MD5(
word) FROM table_name WHERE
MD5(word) LIKE '{$md5}'");
if($r)
while( $row= mysql_fetch_assoc($r) )
print_r($row);
?>