Don't quote me on that

Results 1 to 2 of 2

Thread: Don't quote me on that

  1. #1
    DJM Guest

    Default Don't quote me on that

    How do I deal with variable values that may contain apostrophes (AKA single quotes)? When such a variable is used in an SQL statement, the apostrophe effectively ends the value in the statement, leaving everything after it as SQL gibberish. <BR><BR>variable: lastname<BR>value: d&#039Arby<BR><BR>SQL ends up being "select * from table where lastname = &#039d&#039Arby&#039"<BR><BR>You see the dilemna. SQL thinks the value is &#039d&#039. Nevermind the strange command called Arby&#039.

  2. #2
    Join Date
    Dec 1969

    Default RE: Don't quote me on that

    Hi<BR> You have to use lastname variable value as d&#039&#039Arby<BR>i mean your SQL string should be <BR>sql="select * from table where lastname = &#039d&#039&#039Arby&#039"<BR><BR>Bye<BR>bskumar25

Posting Permissions

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