At the moment I need to store a single variable in a database. I'm used to storing millions of rows of data to a MySQL database but now I just need to store one variable, a timestamp, that changes every five minutes.
I could create a table that looks something like this:
name | value (timestamp)
--------------------------------------------
some_important_time | 1970-01-01 00:00:01
But then I wondered if I would have more variables like that in the future, maybe not all of them timestamps. Should I then use varchar for the values?
name (varchar) | value (varchar)
-------------------------------------------
some_important_time | 1970-01-01 00:00:01
-------------------------------------------
my_integer | 123
Or should I do something like this:
some_important_time (timestamp) | my_integer (int)
----------------------------------------------------
1970-01-01 00:00:01 | 123
What do I do if I have 100s of these kinds of variables?
Is there perhaps another way to do this in MySQL than to use tables?
I know I could just go ahead and pick one but I ask because I still have a lot to learn when it comes to MySQL and in the past, I have made assumptions that are making things harder for me now.