I was doing work on one of my contracts when I came across an error message that was just not going away. What I was doing was selecting rows from a ‘users’ table where the ‘desc’ column = ‘yes’. So the query goes: select * from users where desc=’yes’; or so I thought. Since it had been a while since doing MySQL, I was trying to do quick fixes which were not working. Later on, I realized that ‘desc’ was a MySQL keyword, and then put the quotes ‘desc’ in the query (which was not done initially). However, this still did not work. After a few tries, I got the real syntax to use for the query, and here it is: select * from users where `desc`=’yes’.
If you noticed, the quotes is not the single quote used, but the `, i.e. the one with the tilde key (~). Anyways, now my code is working, and everything looks good. Cheers.