I have this idea where I make a multi/non-multi dimensional array into a JSON string using PHP's
SELECT data FROM users WHERE name='john'
Proper escaping and you are fine but I must add that this is where XML is the better format than json since it will also allow you to do also use the data inside the xml in your queries
<?xml version="1.0" encoding="UTF-8" ?> <user> <gender>male</gender> <birthday>8-Jan-1991</birthday> <country>UK</country> <city>London</city> </user>
SELECT ExtractValue(data, '//gender') AS gender FROM users WHERE name='john' AND EXTRACTVALUE(data, '//country') != 'UK';