I have a rather large amount of data I need to string together (31 variables to be exact), and unfortunately some of the data is numeric data which includes a comma. For instance here is a small piece of what I may need to enter:
'101,828', '152,493', '93,638', '19,987', '7,375,059'
First of all, am I correct to use single quotes around the data I am entering, or am I safely able to remove the single quotes without causing an error? I know using quotes is prefered, but my query is generated partially by using for loops, and I'd like to just toss the place where I add in single quotes.
But my main question is, what do I have to do to enter commas into a MySQL database through php? Can I just add one escape (\) before each comma, or do I need to do something else?
I'd hate to have to strip out commas and then add them in later, but that would be a real hassle to do.
Any help is appreciated, thanks.
'101,828', '152,493', '93,638', '19,987', '7,375,059'
First of all, am I correct to use single quotes around the data I am entering, or am I safely able to remove the single quotes without causing an error? I know using quotes is prefered, but my query is generated partially by using for loops, and I'd like to just toss the place where I add in single quotes.
But my main question is, what do I have to do to enter commas into a MySQL database through php? Can I just add one escape (\) before each comma, or do I need to do something else?
I'd hate to have to strip out commas and then add them in later, but that would be a real hassle to do.
Any help is appreciated, thanks.