I have a table field in a MySQL database:
userid INT(11)
So I am calling it to my page with this query:
\"SELECT userid FR
No. Regardless of the data type defined in your tables, PHP's MySQL driver always serves row values as strings.
You need to cast your ID to an int.
$row = $result->fetch_assoc(); $id = (int) $row['userid'];