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
For mysqlnd only:
mysqli_options($conn, MYSQLI_OPT_INT_AND_FLOAT_NATIVE, true);
Otherwise:
$row = $result->fetch_assoc();
while ($field = $result->fetch_field()) {
switch (true) {
case (preg_match('#^(float|double|decimal)#', $field->type)):
$row[$field->name] = (float)$row[$field->name];
break;
case (preg_match('#^(bit|(tiny|small|medium|big)?int)#', $field->type)):
$row[$field->name] = (int)$row[$field->name];
break;
}
}