1

I have been trying to learn a bit more about some back end technologies recently, and I have managed to create a search form which uses AJAX to perform a live search. The results from live search are all listed manually in an XML file.

Is this the way live search is normally done? If so, how do I ensure the XML file 'talks' to my database to constantly update itself with results? Or should the live search be looking at the database/tables instead of an XML file all together?

Richard James
  • 123
  • 2
  • 2
  • 12
  • Similar question: http://stackoverflow.com/questions/5570502/static-array-vs-mysql-php-vs-xml-file-to-update-via-ajax and http://stackoverflow.com/questions/993282/php-is-json-or-xml-parser-faster – Zul Feb 24 '12 at 08:46

2 Answers2

0

If you are the only one who is going to use the info from the database i would go for directly querying the database.

If others will use the info from your database as well, it is more appropriate to create a web service. You can do it simply by having a php file which fetches data from the database, and parses it to json (you can use the json_encode function) or to xml. Remember to set the appropriate headers.

Use XML if you have complex data/relationships or if you use intricate search algorithms. I would recommend using JSON if you only want to show the data, and for simple data sets.

Armando
  • 63
  • 6
0

I believe it is a logical error ... i was setting Visible property of nothing lol Read the whole article to see what i mean: How to get rid of the XML Parsing Error

Please note that your problem could be not identical but possibly it can be a logical error yet.