I would like to know if there is any way to rename the keys of an associative array that is given by PDOStatement :: fetch. The sentence that I prepare and execute in SQL does not come to the case in itself (although if they require it, I can add it). The fact is that I ask my database for several records through INNERs and in 3 tables the column "id" is repeated. When I want to access through the array that PDO returns, problems arise due to the names of the keys, which makes development very difficult for me. I tried to specify the fetch mode to 'NUM' without success (by default, FETCH () sets the mode to FETCH_BOTH). Will there be any way to rename the array keys?
Note: I have thought about changing the names of the columns, since at this moment they are few, but I would not believe that it was a viable solution (or very intelligent).
I have also thought about using the function array_map () and going unlinking with unset, but being a non-native in php, I have not obtained good results.
Thank you in advance.