

The following MySQL script, for international sites, takes a vertical column list of items turns it on its side, so the list is comma separated into the swatch_item_number field.
MySQL code
The following PHP script, for international sites, lists products with swatch count.
PHP code. An example is at Italy’s site.