SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,

    i use this sql statement:
    Code:
    "UPDATE webhost SET Description='$description' WHERE Email='$email'"
    if the $description contains strings that dont have apostrophies in it, it will update the table, but if there's an apostrophy somewhere in the string, the table will not be updated.

    Can anybody help?

    Thank you
    Sang N.
    -------------------------------
    Send an E-card today!
    http://ecard.vinasite.com

  2. #2
    SitePoint Zealot oodie's Avatar
    Join Date
    Jul 2000
    Location
    Misty Mountain
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to escape the aposthrope with '\'. So instead of :
    $question = "What's this?";
    use this :
    $question = "What\'s this?";

    or you can use PHP's addslashes() function :
    $question = addslashes($question);


Bookmarks

Posting Permissions

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