I don't want to bare with you. I don't know you well enough. I'm prepared to bear with you, though, long enough to point out that SQL is SQL and as far as PHP is concerned any SQL command is just another string.
You're only going to get one row back (because the sum is in the query) so the loop is overkill.
Your single quotes around [font=monospace]$preset[/font] is going to break things. You want each string to be quoted, not the whole thing. You're searching for records with the name [font=monospace]'foo,bar,baz'[/font] and not records with names in the list ([font=monospace]'foo'[/font], [font=monospace]'bar'[/font], [font=monospace]'baz'[/font]). No wonder it's not finding any.
In other words, you're going to have to go through the [font=monospace]$preset[/font] array and quote all of the strings in it, then implode. This is a main reason why I used the PDO interface instead of the outdated MySQL one: it does the appropriate quoting and escaping for you.
And while MySQL probably silently casts strings to integers, making it do so is just wasted effort. [font=monospace]0[/font], [font=monospace]7500[/font] and the like don't need to be quoted.