When running a SQL query I am getting a strange NULL result. Here is the query:
SELECT * FROM plan LEFT JOIN bill ON plan.planID = bill.planID AND bill.typeID =3 WHERE bill.billID IS NULL
I am running the query in PHP using a PDO object. All of the results are coming out as such:
Array ( [planID] => [0] => 7 [clientID] => 4 ...)
The problem lies within the first value returned. As you can see PlanID is NULL but when the same value is pulled with the numeric key, it appears properly as "7". I have tried to address the issue by adding PDO::FETCH_ASSOC to the query code, but I get the following result:
Array ( [planID] => [clientID] => 4 ...)
I do not understand how or why this is occurring. Any help is much appreciated!
plantable?[0]=> 7