views:

131

answers:

1

I tried to do this:

 INSERT INTO test123 VALUES(Some text, 'More Text (and in braces.)');

but it doesn't work. The braces in the string

 'More Text (and in braces.)'

cause the syntax error. How can I make it work - I need mysql to accept the braces.

+2  A: 

I suspect the syntax error is more likely caused by the fact that "Some text" isn't in quotes. Try fixing that first.

MySQL's syntax errors can be rather vague at times; it probably pointed you to a region of your query rather than the particular tripping spot.

Also, {} are curly braces. () are parentheses or brackets, depending on which type of English you're speaking :)

Matchu
its ok, I have a primary key.this works: INSERT INTO test123 VALUES(Some text, 'More Text and in braces.');
creativz
...it does? Because it looks like it most definitely shouldn't. Check your table to make sure that you're getting the desired results - is there something about a primary key that would allow non-quoted string? If so, that sounds like a really pointless "feature."
Matchu