0

My site is build on PHP and MySQL. I want to use JSON to save new messages like comments or something so that they could be pushed to the client instantaneously and it can also save the scarce database sources.

How to do that?THX!

dotslashlu
  • 3,361
  • 4
  • 29
  • 56
  • I have been hunting for a script that does this. Yes I could (and am half way though) roll my own. But all the PHP / mySQL scripts like http://www.hotscripts.com/category/scripts/php/scripts-programs/news-publishing/ publish in XML or RSS. Whereas for iOS, JSON is so easy to handle it seems a shame to drop back to XML. (I save a sub set of the news items in CoreData on the client) – Nick T Mar 19 '13 at 08:58

1 Answers1

0

Using JavaScript/AJAX to send and retrieve messages from the client to the server. See jQuery AJAX.

Raoul
  • 3,849
  • 3
  • 24
  • 30
  • Yeah, I got your point, THX. And I believe a $.getJSON() function could be more convenient. But what I really want is a thought of how to build the server part and the client part to realize that idea. :) – dotslashlu Jul 06 '11 at 15:46
  • ^-^ That's great! The very last question: is using JSON instead of another ways to save feeds count a good idea? – dotslashlu Jul 06 '11 at 16:08
  • @LotusH If you mean sending data back and forth from server to client, yes. – Raoul Jul 07 '11 at 07:33