I had this line of query
$sql = " SELECT c.name, IF(a.addressid IS NOT NULL,0,1) AS checked
FROM customers c
LEFT JOIN addresses a
ON c.customerid = a.customerid
WHERE customerid = 123 ";
$array = array();
$GetResult = $Obj->FetchData($sql, $Obj->DEFAULT_PDO_CONNECTIONS);
while ($row = $GetResult->fetch()) {
$array[] = $row;
}
header("Content-type: application/json");
$result = json_encode($array);
echo $result;
when I echo in JSON format it show my checked
output as a string. And I wonder by default what data type for alias checked
? And how can I change into integer data type?