Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql queries - performance loss by putting numbers in quotes?

If a variable will always be a number, is there a performace loss by putting it in inverted commas?

for example

"SELECT prod.product_name FROM prod WHERE prod.id = '$id'";
like image 386
Haroldo Avatar asked Jun 16 '10 10:06

Haroldo


1 Answers

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.

like image 187
1s2a3n4j5e6e7v Avatar answered Oct 10 '22 03:10

1s2a3n4j5e6e7v