query('SHOW TABLES'); while($result->next()) $existingTables[] = $result->getString(0); if(!in_array('exchange-rates', $existingTables)) $conn->execute(' CREATE TABLE `exchange-rates` ( rate_from BINARY(3) NOT NULL, rate_to BINARY(3) NOT NULL, rate_value DECIMAL(20,6) NOT NULL, rate_stored TIMESTAMP NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (rate_from, rate_to), KEY rate_stored (rate_stored) ) ENGINE=InnoDB COLLATE="utf8mb4_bin" '); } }