通过查询本身在数据库级别反序列化 [英] Unserialize through query at database level itself

查看:141
本文介绍了通过查询本身在数据库级别反序列化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数据库中存储的列值为:

I have a column value stored in the database as:

a:2:{i:0; s:2:"US"; i:1; s:2:"19";}

a:2:{i:0;s:2:"US";i:1;s:2:"19";}

我想在mysql查询期间反序列化它,而不是在获取数据后使用php unserialize函数. 我想这样做,这样我就可以将另一个表与序列化的值连接起来.这样可以避免在用php反序列化之后仅针对连接的数据执行单独的查询.

I want to unserialize it during the mysql query rather than using the php unserialize function after fetching the data. I want to do it this way so I can join another table with the serialized value. This would avoid executing a separate query after unserializing it with php, just for the joined data.

推荐答案

MySQL不知道什么是PHP序列化.你做不到.

MySQL doesn't know what a PHP serialization is. You can't do it.

这篇关于通过查询本身在数据库级别反序列化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆