Detecting type of column according to row
===

In my Lua application, I am trying to create a utility function that sets a specific user data. It uses this format: `setUserData(int UID, string COLUMN_NAME, mixed ROWVALUE)`
It saves the data in a MySQL database.

I'm not sure how to create the column (if it doesn't exist) and detect the type of the value (TEXT, tinyint, VARCHAR etc) to set the column.

Would it be easier and better to always set the column as a TEXT type? If not, how can I detect and create? 