I have a database which stores a large amount of data in tables. This works fine, but I have a few individual variables that I need to store which are not "repeatable" in the sense that there will be no need for additional rows to store more copies of them.
I could just create a single table storing these miscellaneous variables and leave only a single row in that table, but that doesn't seem like the most efficient or cleanest option.
Is there a better approach (or ideally a way to store a single variable in MySQL)?
Just create a table e.g. called 'variables' with two fields 'name' and 'value'. Store your variables in this table, and there you go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With