Is there a my.cnf (or php.ini) option/settings which will tell php's mysqli extensions to either return the data with the correct data types (ie: int/float/string) or just string?
I ask because I have 2 instances of identical code (unmodified) on 2 different servers, both using php7 and mysql (mariaDB). However, it seems that one returns the query results as all strings while the other returns the query results with the correct data types.
Calls are along the lines of:
$driver = new mysqli_driver();
$driver->report_mode = MYSQLI_REPORT_STRICT | MYSQLI_REPORT_ERROR;
$mysqli - new mysqli('p:'. $host, $user, $pass, $name);
$mysqli->set_charset('utf8');
$query = "SELECT fieldInt, fieldString FROM mytable";
$result = $mysqli->query($query);
$dataSet = array();
while($row = $result->fetch_assoc()){
$dataSet[] = $row;
}
echo json_ecnode($dataSet);
Please note, i'm aware of the options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, 1); option and understand that it will likely fix the problem. What i'm wanting to know is if there are ANY OTHER settings/options which might affect the data type returned as I have 2 identical instances which are returning data in different types.