The Chess Variant Pages
Custom Search



Game Courier Settings by streetmansd

The number after each settings link indicates how many sections for code have code. The maximum number is 7. Most games require only 5 for full rule enforcement, display of legal moves, and the spotting of check, checkmate, and stalemate. A game with only 2 or 3 probably enforces the rules but doesn't display legal moves or spot check, checkmate, and stalemate. A game with only 1 probably has some setting up at the beginning but doesn't enforce any rules. And a game with 0 simply functions as an inert game board upon which players may move pieces as they wish without any rule enforcement and without any display of legal moves.

Games

Stevens Test Chess 1

stevensTest [5]

MySQL

This script queried the GameSettings table with the following prepared query:

SELECT * FROM GameSettings WHERE Author = :author ORDER BY Game

To avoid SQL injection, the values are passed separately. These are determined by the values in your URL's query string or by what is entered into the form at top. When you leave a field blank, it normally means that it will leave that field out of the query, not that it will search for an empty value. Here is a recreation of what the SQL query would look like with the placeholders replaced by the values:

SELECT * FROM GameSettings WHERE Author = 'streetmansd' ORDER BY Game

The underlying MySQL is handled by MariaDB. A few fields give you multiple options for how to use them. You can search for an exact string match, an exact non-match, a LIKE match, which allows the use of a few wildcards, and a REGEXP match, which allows for very complicated pattern matching. Since these may slow down the search, they should be avoided unless you have a special need for them.


Written by Fergus Duniho
WWW Page Created: 27 August 2017