Dictionary... Key => Value

From the Asset Store
Various Bell Sounds (from small to huge) / 35 Unique Clips / 2:46 minutes of audio

    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.

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads

    This looks the same as this thread so closing this one.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)