I have done this the long and hard way but I know it can be done quicker and easier 😉
If I have a column called ‘puzzle_level’ I wish to have 10 points for each record that is puzzle_level=5, 25 points for each record where puzzle_level=6 and 50 points if puzzle_level=7;
Quick edit, I actually need a varialbe total in PHP, so it would be $total_points = $sql_formula
You can simply do it with a conditional
CASEexpression:This adds an amount of points based on the puzzle_level to the total point amount in the
pointscolumn.Then, simply reference the
'totalpoints'column in PHP.