Is there any operator equivalent to === in MySQL which checks value as well the datatype?
I have a u_id field in a database which is int datatype
now from login page where user enter user id and during logicheck I write below code
$loginCode = mysql_real_escape_string($_POST[userCode]);
$sql=SELECT * FROM tbl_user WHERE u_id=".$loginCode ;
$result=$db->query($sql);
This returns a row
now when enter 2.0 then it also return the row which I don't want, what I need is when 2.0 is written, query does not return any row.
gettype($loginCode) return string....
it's strange how a integer type(u_id) field can compare with string type in mysql? Please suggest me solution or any better way