I was wondering if using some sort of serialized data whether it be json encoded or serialized etc. was better than using multiple columns in a mysql database.
Example: If I have a "users" table, some columns would usually be: id, fullname, username, email, password etc.
But what if I used json data instead of having all these columns. Could I use just a 2 columns in my db table (id, data). So I could do something like this in php:
json_encode(array('username' => $_POST['username'], 'password' => md5($_POST['password'])));
And then insert it into a table with a column of "data" which would hold the json encoded array.
Later on in the script, I could just retrieve the 'data' column and use json_decode($stuff_from_db, true)
I'm sorry if this is a dumb question, I'm not really very knowledgeable about mysql and how it scales etc. But I would like to know if this would be a good or bad idea.
Thanks