I have a following form:
Yes, this is possible. But you could also use a hidden field:
Please be aware that your code is very vulnerable to sql injections!