I have a column value stored in the database as:
a:2:{i:0;s:2:\"US\";i:1;s:2:\"19\";}
I want to unserialize it during the mysql
It's a very bad practice to add programming language dependent structures to database. If you do so, you always have to rely on that language.
The best approach is to have normalized table structure (different fields or tables).
The next approach is to save data as a delimited string (e.g.: 0,US,1,19
). Then you can use MySQL's SUBSTRING()
or to use standard serialization mechanisms like JSON encode.