Reputation: 21838
I know its supposed to improve performance and clean strings, but lets say there are no variables?
Might just be a
SELECT COUNT( `column` ) AS count FROM `table`
SELECT
statement should not be prepared?Upvotes: 2
Views: 275
Reputation: 75456
A general rule: If the query contains user input, it should be prepared. Otherwise, you don't have to. Your example doesn't need to be prepared.
Upvotes: 4
Reputation: 88796
As a general rule, you should prepare statements that take variables from somewhere else. Usually this includes INSERT
and UPDATE
statements, SELECT
s and DELETE
s with WHERE
clauses, and stored procedure calls with arguments.
Upvotes: 7