Xml file parsing system

Is it practical both to a MySQL database and/or an xml file parsing system to provide realtime incremental voting results on a website. For example, rather than viewing a static result "50.6%', users would see the realtime fluctuation of the voting as it was submitted. I spoke with someone who has attended several mysql training courses, and he said "it's too much of a strain on the database". I am curious if just using an xml based system would be more practical. I'd love to hear your thoughts. Thank you for your time.

Showing Answers 1 - 3 of 3 Answers

This can be done by using JSON the records are fetched from the database and the computation of the percentage is done using JSON methods which are Javascript method . Here is a attached code which shows a poll submit method . Hope it helps 


function pollSubmit() {
var sUrl = '/checkPoll';
var postData = "";
var list = document.getElementsByName("qpoll");
for(i=0;i<list.length; i++){
if (list[i].checked){
postData = "qpoll="+list[i].value;
}
}
/* TODO   these  lines will be moved to the success fn*/
document.getElementById("pollBox").style.display = "none";
document.getElementById("pollBox1").style.display = "block";
var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, formPollCallback, postData);


}


// Get the the elements by name from the JSP 
//This was in the Javascipt file 
  var radios = document.getElementsByName("qpoll");
  for(var i=0;i<radios.length;i++){
   radios[i].checked = false;
   YAHOO.util.Event.addListener(radios[i], "click", poll);
  }


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions