While debugging an application I found that the SQL results had strings where integers should be. As it turns out integers and floats are not cast to their respective data types. I have only looked at the mysqli extension so far but the page from PHP: mysqli_result::fetch_assoc - Manual defines return values as:
Returns an associative array of strings representing the fetched row in the result set, where each key in the array represents the name of one of the result set's columns or NULL if there are no more rows in resultset.
So the resulting data types would all be strings if a cast is not performed. It took the better part of the day to determine the problem. I ended up casting to integer client side since the returned columns have the same array indexes for the page in question. If this was intended or caused by inconsistencies between database servers there should probably be a note about it somewhere.
While debugging an application I found that the SQL results had strings where integers should be. As it turns out integers and floats are not cast to their respective data types. I have only looked at the mysqli extension so far but the page from PHP: mysqli_result::fetch_assoc - Manual defines return values as:
So the resulting data types would all be strings if a cast is not performed. It took the better part of the day to determine the problem. I ended up casting to integer client side since the returned columns have the same array indexes for the page in question. If this was intended or caused by inconsistencies between database servers there should probably be a note about it somewhere.