PHP/Mysql: Searching serialized data for a string -


this question has answer here:

i have started work on project else created, has done:
in mysql table has text field called "alldata", in field has serialized records this

a:13:{s:12:"currencycode";s:3:"sek";s:11:"senderemail";s:18:”xxxxxgu7@gmail.com"; s:4:"hash";s:32:"ebdeb85d094cefd102b630fa9e69d9ca";} 

(there's lot more data cut down around 95% not mess page)

any idea how can search above data senderemail or hash?

select * table alldata '%"xxxxxgu7@gmail.com"%' , alldata '%"ebdeb85d094cefd102b630fa9e69d9ca"%' limit 1;; 

this example should allow search specific hash , senderemail in table , return entry if match of both fields exist in serialized data. useful put view can retrieved , easily, , of course can see want change email , hash in query. in example return exact entry.

more information:

mysql function

search inside serialize data mysql


Comments