troubleshooting Question

Inserting/updating an integer field with the number in single quotes

Avatar of andieje
andieje asked on
MySQL ServerPHP
7 Comments1 Solution1183 ViewsLast Modified:
Hello

I am using php to insert/update mysql and the code I have automatically puts all parameters in quotes for an insert/update statement etc. I have read elsewhere that this is generally considered bad practice

http://stackoverflow.com/questions/6781976/mysql-quote-numbers-or-not

One of the reasons was that if the integer that is in quotes is in a where clause then the optimiser cant use the index.
However I was wondering if an integer is in quotes in an insert or update statement, will mysql still create/update the indexes on that column properly?

Thanks a lot in advance
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros