Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong result from query

Tags:

php

mysql

I have this simple query

SELECT * 
FROM  `book` 
WHERE  `BookID` =  '7u'
LIMIT 1

i expect empty result But i see one result with book id =7. BookID is auto increment. Why query ignore 'u' character?

like image 739
user1903750 Avatar asked Feb 08 '26 05:02

user1903750


1 Answers

Because 7u is not numeric, so apparently mysql is ignoring the u.

Maybe you are thinking of some high level programming languages which use suffixes to qualify the type of number? In C-derived languages, 7u would be an unsigned integer with value 7.

like image 132
wallyk Avatar answered Feb 12 '26 16:02

wallyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!