Let's see if I can explain what I am trying to do here.
I am creating a (for fun) diagnosis tool for my website. The idea is to have users fill out a checkbox list of things like vomiting, diarrhea, increased thirst, etc.
Then, that goes to a php file to be processed. What I want to do is something like this:
If vomiting is checked then add one point to each disease condition that includes vomiting such as pancreatitis, gastritis, etc.
Then, at the end, I want to add up each of the totals and display the top 5.
I'm pretty sure I need to store these as arrays, but I just can't get my head around how to do it!
If you'll forgive a slightly off topic observation, that's a very worthwhile idea! You might think about writing it in a MySQL based CMS. The actual MySQL query is very few lines of code (two or three) and the database is then easily expanded to encompass a vast array of symptoms and diseases. It could even be enhanced to receive feedback and refine its diagnostics accordingly.
(I'm not doctor and am not claiming vomiting is a significant mumps symptom, just making an example. )
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Tirna...your way is pretty much how I was doing it, but I needed the foreach line.
You guys rock!
And Nog...You'd probably make a great doctor...a doctor has to be able to explain things to people and you do that well!
Nog, do you remember when I first came online a year ago and you helped me figure out how to learn php, mysql, etc? My site has been up and running for a while now and is really doing well!
Tirna...your way is pretty much how I was doing it, but I needed the foreach line.
You guys rock!
And Nog...You'd probably make a great doctor...a doctor has to be able to explain things to people and you do that well!
Nog, do you remember when I first came online a year ago and you helped me figure out how to learn php, mysql, etc? My site has been up and running for a while now and is really doing well!
I can't say I specifically remember that, but I recognized your user name, so I suppose there's something hidden in the musty file cabinets of my memory.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks