I am trying to figure out how to do a water medication calculator for pigs with php and mysql and forms. I have a database set up with the amount of water a piglet will drink at ?weeks of age.
id | age | water |
1 | 1 | .23 |
2 | 2 | .35 |
3 | 3 | .38 |
4 | 4 | .52 |
etc up to 21 weeks of age.
I also have another table with the different drugs listed and their dosage rates.
Next I have a form with 3 inputs.
How many pigs? text input
What age are the pigs? Dropdown
How many days you’d like to run the treatment. dropdown (for cost work ups)
submit button.
What I’d like it to do is for me to tell it the age of piglet I’m after, then it tells me the amount of water that age piglet should be drinking. This is done in excel with the vlookup function. Seems everything I’m finding online just gives info about tables.
Can someone point me towards information? thanks so much.
PS, sorry, it doesn’t look like the table is coming out very well.