I Am An Idiot
I did something very silly today. I was working on my CMS Project today, but having problems. I was working away at a form for adding categories via the back-end of the system, but wasn't getting very far. The categories live in a SET column, which can take up to 64 variables, any number of which can be used for a particular post. If none are ticked, the post goes to a 'General' category. Anyway, updating a SET field takes some doing, so to edit it I need to go through the following process:
- Retrieve the field from the database which contains all the variables
- Remove the closing bracket so I can add the new variable;
- Retrieve the new variable;
- Add the new variable, along with the closing bracket again.
Nice and easy. The trouble was, it didn't do anything. It worked perfectly in phpMyAdmin, but not on my self-written script. I couldn't understand it. The code was perfect - I used echo() on my browser to make sure it was. I made sure all the slashes were correct. I used stripslahes(), addslashes(), and almost resorted to slashwrists(). But then it hit me.
I hadn't actually run the query on the database. I'd written all the PHP code to deal with the results the query would show up, but I hadn't actually run the query.
What a muppet I am. Please don't make the same mistake as me.
There are currently no comments on this article.
