Invalid field name
I have a field name:
I have a simple query to change it based on its state (0 or 1).
my query is run by php, but it won't change.
I assume its because the character ("/") is illegal.
How can i get round this problem.
Don't use the / in your column name. Rename the column (you'll need to use a SQL client to do this, not PHP) to something like Tea_Coffee.
Changing the field name is NOT an option, i did not set up the database and thousands of sites would need updating if i renamed this field.
Sorry i should have stated that.
What i need is a workaround, strangely when i'm reading in the data it displays correctly, anyone know why that is???
To be honest, there is no work around. You can try encapsulating the field name in back ticks, `Tea/Coffee` but in all honesty, that is an invalid column name. MySQL's partially to blame because it let whoever made the table make it with the character, but the DBA in question should have known better, in my opinion.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)