Hi. I've been trying to populate a dictionary with rows from a PHP file. The dictionary contains keys, while the value is just [Object object].
Here's my code:
function ajax_load_inventory($source = '1',$player_id) {
$player_id = 20;
// Build query - grab all rows from inventory table that are owned by the player id
$sql = "SELECT * FROM inventory WHERE avatar= '".$player_id."'";
// Execute the query and store the result
$results = execute_sql($sql,'0');
// Fetch all
$row = mysqli_fetch_all($results, MYSQLI_ASSOC);
//Output array for c2array use
outputAsC2DictionaryJSON($row);
} // ends function load_inventory($source = 'inventory',$player_id) {
function outputAsC2DictionaryJSON($avatar_inventory)
{
$data = array(
'c2dictionary' => true,
'data' => $avatar_inventory
);
outputData($data);
}
function outputData($data)
{
echo json_encode($data);
// exit(1);
}
Here's the dictionary...
Hope someone can help me with this. It would be a big help. Thank you in advance.