In my PHP file, a have these variables:
$a
, $b
, $c
and $d
.
Depending on the mode a user selects, a different formula should be used to calculate a certain number. I would like to store these formulas in a MySQL database:
ID / Mode / Formula
mode1 namemode1 $a*$b/$c+$d
mode2 namemode2 / $a/$b+$c+$d
etc.
How could I make the string I get when I select it from the database into PHP variables? Is there sort of a best practice for this?