php - Do i have to escape input using mysqli_real_escape_string even though i check it using is_numeric to prevent sql injection -
I am using I think if I use the It was found whether the given variable is numeric or not. Numeric strings include optional sign, any number of digits, optional decimal part, and optional exponential part. Thus + 0123.45e6 is a valid numeric value. There is also permission for hexadecimal (such as 0xf4c3b00c), binary (eg 0b 10101111001), October (eg 0777) signaling, but without any indication, decimal and exponential part referee: The question is Do I have to avoid input using mysqli_real_escape_string, though I check it using is_numeric to prevent SQL injection ? As the input will only have numerical value eg. 555, 222,456, 879 Although I can not think of a specific way of attacking your example, I can not think in a way! "=" This is not possible ". If you come into the habit of checking, and then cross the values, then eventually you will get in Trouble! Your statement "Input is only numeric value like 555, 222 ,456, 879" This is not true because you have given some more complicated examples in your quote - how do SQL + 0123.45 A6 or 0b10? A string in which there is a number For this reason, always the US WARNING STATEMENTS - There is a need to worry about the way you do not do it. If you can find the reason for not using the prepared statement (and I do not think there is one! ) Then lets talk. $ _GET ['id'] to get the ID And see it DB
is_numeric function to check the string, then it is numeric or not, then I use the
mysqli_real_escape_string I>. But recently it was found.
Comments
Post a Comment