query_logsql("INSERT INTO `rewardlogs` (code,redeem_time,account_id) VALUES ('"+.@pc$+"', NOW(), '"+getcharid(3)+"')");
your reward logs was saved in a different table .....in the log scheme.
the sql table you shown above...is it the rewardlogs ??? or reward_codes ??? or ???