I'm using php and mysql. When a user clicks submit button the GET query string is like this:
http://mywebsite.com/category/section?article=1
And I query like this:
"SELECT * FROM
articleWHEREart_id='$article' "
art_id is an int(11) datatype but it accepts a value with letters if I have the correct number as prefix like : http://mywebsite.com/category/section?article=1asd. If I pass all letters (?article=asd) it won't accept but if I pass a number with letter (?article=12asd) it does accept and returns the article with art_id of 12. How can I prevent this?
I've tried it directly on MySQL command line client and it accepts the value with letters in it.
art_id='$article'