I'm trying to insert a row into a table, but only if the combination of the X and Y does not exist in the table already, so I searched around and eventually came up with this query, but it's doing nothing, and throwing no errors.
INSERT INTO `tiles` (`TileID`, `Type`, `X`, `Y`)
SELECT UUID(), (FLOOR(RAND() * 4)), 0, 0 FROM `tiles`
WHERE NOT EXISTS (SELECT 1 FROM `tiles` WHERE `X`=0 AND `Y`=0) LIMIT 1;
Any help is greatly appreciated.