SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP + SQL Server - Entering Data

    Hi all,

    I have created an SQL Server database table 'admin'.

    I Right-Click on the table, then select: Open Table > Query

    Then I create SQL(insert into admin values("test", "test2")
    I verify the code and it is correct.

    However, when I select Run it gives an error message - "Column names are not permitted"

    Why is this?

    Thanks.

    Kevin.

  2. #2
    SitePoint Member
    Join Date
    Jan 2006
    Location
    Bristol, UK
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    It wouldn't be the double-quotes on the text values would it? Does it happen if you use single-quotes?

    Cheers,
    Chris

  3. #3
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup. That does it

    Thanks Chris!!

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by obrienkev
    However, when I select Run it gives an error message - "Column names are not permitted"

    Why is this?
    because SQL Server syntax does not allow the doublequote to be used as a string delimiter the same as MySQL does
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •