Click to See Complete Forum and Search --> : Help! How could I do this?


cialis
06-17-2009, 07:48 PM
Hello, I need a program that could search a database and add up values on that database when typed into a searchbar. For example:

animal / fun / manitenence / "affection return"
dog / __ 6 / ______ 5 / ______ 7
cat /___ 4 /______ 4 /______ 5
fish / __ 1 /______ 1 /______ 0

in a seach bar (live & predictive), one could add dog & cat to a list, select which charteristic they would like to study, then the program would add up the values. So if looking at "fun" for a dog and a fish, the value given would be 7 (6+1).

The database will be hundreds of cells big however. I would like to have this program run in a webbrowser. Unfortunately, I do not have a lot of programming skills, and do not know how I should approach this (use already existing software/freeware/openware, or use html/javascript). If you can suggest anything I would greatly appreciate it. Thanks.

JavaServlet
06-18-2009, 01:26 PM
Sounds like all server side work. View an intro server/db book with a fetch data script. After you get that working then do the math part.

Quick example to get you in right direction using java:
String query = "SELECT FUN FROM YOURTABLE WHERE ANIMAL = 'dog' or ANIMAL = 'fish'";
try {
.......
while (resultset.next()) {
//get values
}
//add/math part.
}


Probably better to create method to do the math part.