Fixed syntax error. And as an extra, SQL error file logging added.
Gamble item implementation is now finished.