The reason you can't find guidance on how to do this is that it's a really bad idea.
Sooner or later, someone is going to pass a "column name" of 1 ;drop database badidea
. Which will be a blessing for all concerned.
Read up on SQL Injection, and rethink your design.