I have a drop down list on a form with values:
Value One
Value Two
Value Three
The values go into a db.
I have another db with columns
Value One
Value Two
Value Three
I have an IF statement that if form Value One to get records in db from Colum Value One.
But getting error message Unknown column ‘Value’ in ‘field list’
I think it has to do with the space? Can I have spaces in the names in MYSQL? If I change it to Value_One, Value_Two, Value_Three can I change the form input Value to be Value%One, Value%Two, Value%Three etc will that work? Ideas?
You can wrap column names, table names, and other identifiers that contain spaces or keywords (like “select”) with backticks:
However, from the sound of it, I’m not sure that is your only issue. A use case where you select a column name in a form and submit it is a strange one.
Is it possible that you are trying to get the values from a single column of the database, instead of multiple columns?
Use
DESC tablenameto find out the column names.