Your first example only uses one variable in the place.
Your second example uses three placeholders, but you don't want categories.id_cat to be compared as a string.
Placeholders only work for constant values, not for column references. You will need to use string interpolation for that.
In reply to Re: Avoid embedding variables in SQL - Dancer App
by Corion
in thread Avoid embedding variables in SQL - Dancer App
by GertMT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |