Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.
I am using two 256 byte blocks inside my table (max size for VARCHAR???)...unless there is a better way - to store 512 bytes? This introduces a potential security problem if anyone figured out the buffer was split on a 256 byte boundry so I escape both...
Can you see anything else wrong with this? Is my math right?
Max size for varchar is 256 bytes, but since one byte is always reserved for the size of the data in the column, the max storage is 255 bytes. If you're using MySQL >=5, varchars can be defined as greater than 255 and the column will reserve an second byte to hold the length.