To summarise, let's look at an overview of the whole process: 1. User clicks 'Fetch Data' button. 2. fetchData() function is called which initiates a AJAX GET HTTP request to the PHP file. 3. PHP creates a secure connection to YOUR database. 4. PHP queries tweets table and returns a results set. 5. PHP loops through the results set row by row and creates an associative array. 6. PHP encodes the associative array in JSON and returns the data using echo. 7. Upon receiving the AJAX request results, a callback function is called. 8. The callback function loops through the returned results and creates a Javascript Object array which will exist outside of the scope of the AJAX request function. 9. The callback function calls the writeTweets() function. 10. The writeTweets() function loops through the tweetData array and writes to the page.