Also, you have in most of them '%d', and only %s needs the '' in a query, as %d means an integer value.
I figured it out, it wasn't the clause infact. However, I also forgot the "%" beforehand. A stupid mistake to make, sorry for my stupidity. On the other hand, thanks.