mmichals Posted March 31, 2017 Share Posted March 31, 2017 I tried to implement the code in Chapter 14 for adding favorites and it's not working. How can I see what the problem is considering it's using an AJAX call? Link to comment Share on other sites More sharing options...
Larry Posted March 31, 2017 Share Posted March 31, 2017 The first step is to run the PHP scripts (that Ajax calls) directly in the browser to make sure they don't have a parse error or whatever. Second, use the network tools in the browser to see the requests being made and the response. Link to comment Share on other sites More sharing options...
mmichals Posted April 1, 2017 Author Share Posted April 1, 2017 OK, Larry. I've never used the network tools in the browser. What are they? How do I use them on Chrome? I'm assuming Internet Explorer is probably not as good for this? There was an error in the ajax/favorites.php script. My hosting provider does not allow REPLACE queries. So I had to change the code to an INSERT query. Link to comment Share on other sites More sharing options...
Larry Posted April 1, 2017 Share Posted April 1, 2017 The issue with the INSERT query is it will fail if you're trying to insert using the same primary key. If you can't use REPLACE, then you should use INSERT for new records but UPDATE for existing ones. As for the network tools, I just Googled and this is a resource for Chrome (which is what I primarily use): https://developer.chrome.com/devtools And you can Google for IE resources: https://www.google.com/search?q=internet%20explorer%20developer%20tools But it'll probably be better if you add in the specific IE version. Link to comment Share on other sites More sharing options...
mmichals Posted April 1, 2017 Author Share Posted April 1, 2017 In my case it's for a real estate website, so I added a column "active". This will allow me to track which properties users are adding as a favorite and then removing that same property. It also allows me to reach out to buyers and see what they like and dislike. In the users dashboard this will be helpful for the user to re-activate any favorites he may have removed by mistake. Thanks for your quick responses, Larry. Always appreciated. So when are you writing a book about using Stripe's Connect platform? I want to get my head around that next Link to comment Share on other sites More sharing options...
Larry Posted April 3, 2017 Share Posted April 3, 2017 Ha! Thanks for the thought. No plans on writing a book about Stripe Connect at the moment, however! Link to comment Share on other sites More sharing options...
Recommended Posts