swati
swati

Reputation: 77

using variable names for prepared statements

I have started to use prepared statements in my php,mysql based application. As I learnt that prepared statement queries will be compiled only once, should we use unique variable names for the queries and the statements prepared for them ? Will it clash if we use same variable names to store the queries or the statements ?

Upvotes: 0

Views: 198

Answers (1)

Your Common Sense
Your Common Sense

Reputation: 157870

It works only within the same mysql session. So, most likely you will run your prepared queries only once, with no use of such a widely advertised "benefit".

Anyway, the variable that contains the query affects nothing but if you rewrite a variable contains prepared statement, you will prepare another query, which is obvious.

Upvotes: 1

Related Questions