This code:
$query = "UPDATE [table] SET number=(number+5)%10 WHERE [index]='2'";
Will set the value to the remainder of (number+5)/10, in this case 1. I actually solved the problem with a mix of php and sqlite.
Function check_input($a)
{
if ( $a > 10 ){ return 10; }
else{ return $a; }
}
sqlite_create_function($db, 'CHECK_INPUT', 'check_input', 1);
$query = "UPDATE picture SET score = CHECK_SCORE(score + $amount) WHERE picture_id == $pic_id";
sqlite_query($db, $query);
I had never used sqlite_create_function function before, and it works very nicely. Thanks for everyone's input.
-Tim