A quote from a user on
this topic that is related to gzcompress.
This is a bad idea because:
- theoretically, there might be a sequence of data that, when compressed, leads to a SQL injection or simply breaks the query
- gzcompressed data can't be properly indexed and searched - you'll have a database full of garbled characters
- gzcompression is computationally expensive
Simply always sanitize your data before entering it into a database, using the string escaping method of your library (like mysql(i)_real_escape_string()) or parametrized queries. If you do that reliably, no further protection is necessary.
You will end up getting an error like:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'cUÓyM›û]YûßTS§mÖø_öè|®SÝT?½¥®Ê!y{ëVùÊP†’Â1�'‰;(§�èh$1Cà�b
Once the game is over, the king and the pawn go back in the same box.