I want to use php to connect mysql and select field type of blob
, but print result like '羂Z娛爌@c?驀'
What should I do
Asked
Active
Viewed 88 times
3

Dipu Raj
- 1,784
- 4
- 29
- 37

jasondayee
- 549
- 4
- 11
-
Going by the column name, it's encrypted data hence the output you're getting. – flauntster Nov 25 '16 at 03:36
-
Here is the similar question with answers - http://stackoverflow.com/questions/20556773/php-display-image-blob-from-mysql – Prakash Saini Nov 25 '16 at 03:37
-
Usually the blob field can be print like text fields with PHP but your filed says encryptedPassword. Do you know what kind of encryption it is? If it is a two way encryption use MySQL DECODE() function if you know the key – Dipu Raj Nov 25 '16 at 03:38
-
this `blob` fields just a text ,This is I use Navicat export sql like ‘INSERT INTO `Entry` VALUES ('1', '1', 'asfdsdf', null, null, 'admin', 0x6AFE61AFEBF15628857F69FB1C037AD4, '3'); INSERT INTO `Entry` VALUES ('2', '1', '啊是å¦å¤§æ˜¯åœ°æ–¹', null, null, 'admindddd', 0x7D66B4A02109AC8D113A215C425CBFD6, '1'); INSERT INTO `Entry` VALUES ('3', '3', 'uid2', null, null, 'admin', 0xC11A8ACAA070401B63A711F2872C0F04, '3'); ‘0x7D66B4A02109AC8D113A215C425CBFD6’ is blob field ’ – jasondayee Nov 25 '16 at 03:50
-
you shouldn't encrypt passwords, – Ryan Nov 25 '16 at 05:33
-
@self you should include that passwords definitely should be **hashed** instead. right now, you comment could be misinterpreted as "plain-text is okay". that said: OPs problem would most certainly be solved by using `password_hash()` and storing those hashes in a text-field instead of a blob-field. – Franz Gleichmann Nov 25 '16 at 06:33