Jump to content

[SOLVED] can have dashs (-) in sql?


jesushax

Recommended Posts

hi all,

 

the top line is the echoed sql and the second line is the error from the sql

 

can i have dashes (-) in a statment? is that what the error is saying?

 

Thanks

 

INSERT INTO tblDirectory2 (Sect1-6, Sect1-1, Sect1-3, Sect1-4, Sect1-5, Sect1-7a, Sect1-7b, Sect1-7c, Sect1-7d, Sect1-8, Sect8-1, Sect1-2) VALUES ('', 'Limited Company', '', '', '', '', '', '', '', '', '0-5', '')

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-6, Sect1-1, Sect1-3, Sect1-4, Sect1-5, Sect1-7a, Sect1-7b, Sect1-7c, Sect1-7d, ' at line 1

Link to comment
Share on other sites

I believe the answer is no, although it probably depends on the flavour of database; but you must have created a table with these column names in the first place for you to insert into it.

 

Did MySQL actually allow you to create a table with these column names? If so, then it shouldn't complain when you use them in SQL statements.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.