<TEXTAREA> values in Database: PROBLEM

Results 1 to 3 of 3

Thread: <TEXTAREA> values in Database: PROBLEM

  1. #1
    Join Date
    Dec 1969

    Default <TEXTAREA> values in Database: PROBLEM

    My pages have Input boxes and Textarea&#039s whoms values are put into a database using SQL statements like:<BR><BR>INSERT INTO (a,b) VALUES (&#039var1&#039,var2&#039)<BR><BR>Now the problem is when var1 has a &#039 in its value. The query is then misunderstood and gives an error. Is there a way to make sure the data that is inserted is correct and does not give errors. Is there a way that &#039 characters are allowed to be passed. Is &#039 the only character that gives problems like these? Perhaps I should replace them using Javascript into ".<BR><BR>Help please

  2. #2
    Join Date
    Dec 1969

    Default RE: <TEXTAREA> values in Database: PROBL

    I have had this problem in the past.<BR>Use:<BR>Replace(var1,"&#039", "&#039&#039")

  3. #3
    Join Date
    Dec 1969

    Default encode the whole string into HTML first

    You can avoid all problems if before you send the field to the database you use:<BR>...<BR>Server.HTMLEncode(string)<BR>...<BR >This changes possible candidates to HTML code, like the space " " becomes "&nbsp;".

Posting Permissions

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