title: Putting JSON string as field data on MySQL
body: <p>I have this idea where I make a multi/non-multi dimensional array into a JSON string using PHP's <code>json_encode</code> and store the data into my SQL database.</p>
  
  <p>For example, I have a table called 'users'. Table 'users' have 3 fields: id, name, data</p>
  
  <p>Using php, I would like to fetch user John's data: <code>SELECT data FROM users WHERE name='john'</code></p>
  
  <p>Now the value/text for 'data' field will  be like this: <code>{"gender":"male","birthday":"8-Jan-1991","country":"UK","city":"London"}</code></p>
  
  <p>I will decode the 'data' field using PHP's <code>json_decode</code> and then I will convert the stdClass object into an array using one of my self-made PHP functions. And then I can show John's information wherever I want like this: <code>$user['data']['country']</code>.</p>
  
  <p>This saves me from the hazel to create extra fields on database for country, city, birthday, etc. But is it safe? Is there any disadvantages or problem with using this method to store data on MySQL.</p>