fetch_assoc()) { // Declare the collaborator $typing[$index]["name"] = $record["name"]; // Declare the idea that is being typed in $typing[$index]["typingId"] = $record["typing_id"]; // Increment index $index++; } mysqli_free_result($recordSet); echo(json_encode($typing)); // Close the connection to the database db_close($database); } catch(Exception $e) { $errorMsg = $e->getMessage(); print_r($errorMsg); } ?>