Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Update via Textarea

    I'm trying to learn to update a table in mysql from a textarea. <textarea rows="30" cols="60" name="content" /><?php echo $row['content'] ?></textarea>. This is the mysql command i use. mysql_query("UPDATE pages SET content='$content' WHERE id='$id'");. I'm not sure why it's not doing it. Also I'm using tinymce as the editor and the area is hard to edit. If anyone has any suggestions please let me know.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Did you ever get it working using just a plain old textarea element? That's what I would do first, before I got into using an additional editor layer.

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Ghost, make sure you are escaping the input. If you are using a WYSIWYG form it is likely inserting elements with quotes in them, and that could be breaking your MySQL query. Not to mention it isn't safe. See the stickies, and the manual page for mysql_real_escape_string().


  •  

    Posting Permissions

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