Finding error when passing string in database

In php fnding error
$Email =$_POST[“Email”];
$Password=$_POST[“Password”];
$rand=“Saj7749”;
$query = "SELECT * FROM userinfo WHERE RandomID=‘$rand’ ";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
echo $count;
it is not working for varchars but working for int

1 Like

then it’s likely that RandomID is an INT field and not a VARCHAR field.

I have a field name ID with int type . The query works fine on that .
But for RandomID, Name, Country fields which are of var char type it is not working

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.