# Saving an Array of Objects to MYSQL Database, and Retrieving It

**URL:** https://forum.kirupa.com/t/saving-an-array-of-objects-to-mysql-database-and-retrieving-it/300768
**Category:** flash
**Created:** [November 27, 2009, 1:38am UTC](https://forum.kirupa.com/t/saving-an-array-of-objects-to-mysql-database-and-retrieving-it/300768 "2009-11-27T01:38:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DrRobot](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/drrobot/32/3907_2.png) [@DrRobot](https://forum.kirupa.com/u/DrRobot)
#### Post date: [November 27, 2009, 1:38am UTC](https://forum.kirupa.com/t/saving-an-array-of-objects-to-mysql-database-and-retrieving-it/300768/1 "2009-11-27T01:38:33Z")

</div>

How do i save an array of objects, like this: [{n:1,bb:4},{n:2,bb:4,r:1},{n:6,bb:7},…] to a database? I was thinking i would have to convert it to string, but if i do that, when i retrieve it from the database, how am i going to use it?

EDIT: forgot to mention that the objects can contain an array of objects as well, but there won’t be any more arrays beyond that point.

[{n:1,bb:4},{n:2,bb:4,r:1},{n:6,bb:7},{arr:[{a:11,b:2},{a:11,b:2},…],r:1},…]
