A long-standing question for me has been: when do I store data (actual values) in a database table, and when do I store them right in the code?
The untold consensus has typically been as such(*):
If it is a single variable or a simple structure, or an array of a few values, put data right in the code.
[* consensus has been debated in comments and answers, but basically I wanted some kind of a premise to jump-start the question, so feel free to challenge and improve upon it]
$number = 44; $colors = array("blue", "yellow", ... "mauve");
If it has hundreds+ of rows of data of the same type, use a database.
But there seems to be a gray area; what about cases that are not so clear? What considerations and factors does one need to pay attention to in order to make a decision?
Say your company uses 10-15 different types of motors frames that can be represented as "412T". You have about 30 of them and they change rarely. You can either create a DB table for those or hard-code them in a database. In this case, motors are static, physical things that are not likely to change often.
Keeping them in code subjects them to source control, where in a database, DB changes are typically not tracked. But keeping them in a database frees up (separates) code from data.
Another (actual) example I can use is this question of mine: https://stackoverflow.com/questions/26169751/how-to-best-get-the-data-out-of-a-lookup-table (currently 48 rows of option data).