List:General Discussion« Previous MessageNext Message »
From:Andy Pieters Date:April 16 2005 8:18pm
Subject:4==4something: equal vs identical
View as plain text  
Hi everone

I ran into some situation where MySql selects a row by using the following 
query:

SELECT `id` FROM `shop_products` WHERE `id`="4aef" LIMIT 1;
+----+
| id |
+----+
|  4 |
+----+

Granted the field IS of type int but 4 is not identical to 4aef (it may be 
equal to the eyes of MySql)

Isn't there an MySql equivalent of === (test for same+same type) or should I 
just ignore this.


With kind regards


Andy

-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>++++$@ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

Attachment: [application/pgp-signature]
Thread
4==4something: equal vs identicalAndy Pieters16 Apr
  • Re: 4==4something: equal vs identicalPaul DuBois17 Apr
Re: 4==4something: equal vs identicalEric Bergen19 Apr