I am trying to get data from a MySQL database with PDO but unfortunately PDO returns the result as an array of strings. I want to keep the native MySQL data types in the result array.
I have tried setting PDO::ATTR_DEFAULT_FETCH_MODE to both PDO::FETCH_ASSOC AND PDO::FETCH_OBJ but it was still returning INT data as string.
Here is the result of dump:
array (size=1)
0 =>
object(stdClass)[27]
public 'id' => string '3' (length=1)
public 'avatar' => string '' (length=0)
public 'fullName' => string 'Mikheil Janiashvili' (length=19)
public 'email' => string '[email protected]' (length=17)
public 'phone' => string '23 3537 20 03544' (length=12)
public 'educationGE' => string '' (length=0)
public 'educationEN' => string '' (length=0)
public 'educationRU' => string '' (length=0)
public 'experienceGE' => string '' (length=0)
public 'experienceEN' => string '' (length=0)
public 'experienceRU' => string '' (length=0)
public 'descriptionGE' => string '' (length=0)
public 'descriptionEN' => string '' (length=0)
public 'descriptionRU' => string '' (length=0)