SQL Error

Results 1 to 2 of 2

Thread: SQL Error

  1. #1
    Join Date
    Dec 1969

    Default SQL Error

    I am getting an error with my SQL when someone tries to register some details on my website. I am using ASP with a MySQL Database.<BR>The Error is as follows:<BR><BR>INSERT INTO table1 values(&#039Sam&#039s&#039,&#039Place&#039, NULL)<BR><BR>You have an error in your SQL syntax near &#039s Place&#039, NULL)&#039 at line 1<BR><BR>The error is being caused by the apostophe in sam&#039s. <BR><BR>How can I resolve this ?

  2. #2
    Big Al Guest

    Default RE: SQL Error

    Quite simple don&#039t use this sysmbol &#039 in any fields when writing to a database as ASP thinks that you are calling a varable or string. and so they must be in pairs. if you change the name of you varable to sam`s or sams then it will work fine.

Posting Permissions

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