I've got a function that gets data from a NoSQL database, and if it's not available then it goes to a MySQL database to get the data but the issue is, the function is putting the data into the array twice and I can't figure out why.
Expected result
array(2) {
["id"]=> string(2) "30"
["username"]=> string(8) "Username" }
Actual result
array(4) {
[0]=> string(2) "30"
["id"]=> string(2) "30"
[1]=> string(8) "Username"
["username"]=> string(8) "Username" }
Code
Code that is irrelevant to the problem is removed and replaced by pseudo code comments.
$Connection = $this->Connect("MySQLi");
$Data = MySQLi_Fetch_Array(
MySQLi_Query($Connection["MySQLi"], $Options["Query"])
);
echo "Got array (MySQLi).";
It's worth noting that the string "Got array (MySQLi)." only appears once.