I have a table:
CREATE TABLE `ids` ( id int(11) not null auto_increment, PRIMARY KEY (id) );
It contains some IDs: 111, 112, 113, 1
lame + kills optimization but serves it purpose
SELECT * FROM `ids` WHERE concat(id) = '112abcdefg';
that way you enforce casting to string http://dev.mysql.com/doc/refman/5.1/en/type-conversion.html