#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    14
    Rep Power
    0
    Hi I have the following table (real simple):
    CREATE TABLE txttest (comments TEXT);

    I then use a <textarea> to enter text.
    This text then gets inserted into the table above.

    I was told to use: $comments=urlencode($comments);
    before inserting into my database

    This WORKS when I type in something like:
    "this is a comment line" (looks like: this+is+a+comment+line)
    BUT
    if I type in something like:
    "this is a comment line,
    this is another comment line"
    (looks like: this+is+a+comment+line%2C%0D%0Athis+is+another+comment+line)

    I get this error:
    Error in executing INSERT INTO txttest (comments)VALUES('this+is+a+comment+line%2C%0D%0Athis+is+another+comment+line')
    error:1065 Query was empty

    ANY IDEAS??

    Thanks
    Mike
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Mike,
    escape from special character using ''(ie,"I'm shiju").if you are using mysql with php then you may try addslashes() php function to escape from special characters.



    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."

Similar Threads

  1. League table problem
    By silverduck in forum MySQL Help
    Replies: 8
    Last Post: February 10th, 2004, 12:38 PM
  2. how to keep table on top, not centered??
    By vinyl in forum HTML Programming
    Replies: 2
    Last Post: January 20th, 2004, 06:19 PM
  3. Replies: 1
    Last Post: January 1st, 2004, 01:45 PM
  4. Replies: 0
    Last Post: December 30th, 2003, 12:57 PM
  5. Replies: 1
    Last Post: December 30th, 2003, 11:10 AM

IMN logo majestic logo threadwatch logo seochat tools logo