So it's a difference of the PHP and C, rather than the MySQL code itself? That makes sense. But I do wonder, just relative to the MySQL part (eg, the actual searching in the query), whether they run at the same speed. The PHP loop, for example, probably is slower than a C loop, but if MySQL via PHP is slower than MySQL via C, that's worth knowing.
the loop that constructs the query would be faster, yes - the execution of the statement would be the same. MySQL is MySQL. Of course, the actual savings probably wouldn't be noticeable unless you had a _lot_ of traffic. and most web hosts don't give you enough access to write stored procedures unless you have a private server anyway.
can be simplified as:Code:SELECT * FROM table WHERE col != 'this' AND col != 'that'
Conversely:Code:SELECT * FROM table WHERE col NOT IN ('this','that')
can be simplified as:Code:SELECT * FROM table WHERE col = 'this' OR col = 'that'
These were the only two shorthand functions I could find. refCode:SELECT * FROM table WHERE col IN ('this','that')
To choose the lesser of two evils is still to choose evil. My personal site