database query (via javascript ore sql)

database query (via javascript ore sql)

by Nicola Ribatti -
Number of replies: 0

Hi anyone. I Have created a database activity in wich student insert their name, activities and hours of activity. How  can I get the amount of the hours for each student?  Is it possible with javascript or sql query?

In the firs case, I've found in the forum a javascript wich gets the amount of all hours, but not for single studente:

_________________________________________

var timespent = 0;
var totalHrs = 0;

function timecount () {
   var timespent = document.getElementsByClassName("singleservice");
         for (i=0; i < timespent.length; i++) {
         totalHrs += timespent[i].innerHTML*1;
      }
document.getElementsByClassName("totalHrs")[0].innerHTML = totalHrs;
   }
window.onload = timecount;

__________________________________________

How can I modify it in order to have the amount for each student?

In the second case, How can I get the tables name in order to create the query?


  Thank you very much

Average of ratings: -