Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个关联数组,将它放入数据库(mysql)的最简单方法是什么?我的意思是序列化并放入 SINGLE 字段。请注意,序列化后,我需要能够反序列化字段。
像这样的东西。
$arr=array("data","more data"); $result=mysql_real_escape_string(serialize($arr)); mysql_query("INSERT INTO table (serialized) VALUES ('{$result}')");