Inserting & selecting array content with MySQL?

For example, I have 1 array:

Array(
    [Griffin] => Array (
        [0] => Peter
        [1] => Lois
        [2] => Megan
    )
    [Quagmire] => Array (
        [0] => Glenn
    )
    [Brown] => Array (
        [0] => Cleveland
        [1] => Loretta
        [2] => Junior
    )
)

Please let me know how to insert & select 1 array with the multi level to 1 field MySQL type as below:

a:9:{s:8:"platform";s:7:"Windows";s:4:"name";s:6:"Chrome";s:7:"version";s:11:"16.0.912.75";s:10:"update_url";s:28:"http://www.google.com/chrome";s:7:"img_src";s:49:"http://s.wordpress.org/images/browsers/chrome.png";s:11:"img_src_ssl";s:48:"https://wordpress.org/images/browsers/chrome.png";s:15:"current_version";s:2:"16";s:7:"upgrade";b:0;s:8:"insecure";b:0;}

Answers


Seems you are looking for serialize.


Need Your Help

Authentication with Spring Security + Spring data + MongoDB

java spring mongodb spring-security mongodb-java

I want to use Spring security with MongoDB (using Spring data) and retrieve the users from my own database for spring security. However, I can not do that since my userservice type does not seem to...

Facebook SDK error loading on Windows 10 app (XAML, C#)

c# facebook visual-studio winrt-xaml

This is very odd, yesterday this project loaded fine and today it doesn't want to.