I have a query in which I insert data with json_encode(), and I am trying to receive that data with json_decode(), however, I get an error message that is something like this:
stripslashes() expects parameter 1 to be string, array given in
I have this database table that has about 20 fields. So, this is how I am trying to retrieve the results:
if($q->rowCount() > 0) {
while($r = $q->fetch(\PDO::FETCH_ASSOC)) {
$array[] = $r;
}
return $array;
}
The results come back fine, but I can't seem to get pass this stripslashes error. I've also tried json_decode($json_string, true); with no luck. I am hoping that someone can point me into the right direction.