Originally Posted by tpeck
If a user logs in to a site - username and PW - could that login be used to save his/her answers discreetly to the database?
If "discreetly" means covertly or clandestinely or surreptitiously then I think there is a moral issue to consider.
It is your responsibility to die() if necessary….. - PHP Manual
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.