开发者

mysql queries - performance loss by putting numbers in quotes?

开发者 https://www.devze.com 2023-01-03 10:43 出处:网络
If a variable will always be a number, is there a performace loss by putting开发者_JAVA百科 it in inverted commas?

If a variable will always be a number, is there a performace loss by putting开发者_JAVA百科 it in inverted commas?

for example

"SELECT prod.product_name FROM prod WHERE prod.id = '$id'";


No, you won't have any performance loss by putting them inside inverted commas. But do take care of sql injections in such kind of queries. Also note that performance means many things, you've to be specific. Generally, it works fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消