#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    61
    Rep Power
    15
    If I enter text into a field containing an apostrophy ' the script run through ok but doesn't place the data in the table ????? What's the answer to this?

    I'm totally clueless here.
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,648
    Rep Power
    4493
    Having a single quote in an SQL query will cause an error, they need to be escaped with the backslash character .

    you can use addslashes($text) to escape all the quotes, and then use stripslashes($text) to remove the escapes (when you pull it back out of your database).

    If you administer PHP yourself, look at magic_quotes in the manual. It automates the escaping, so you don't have to run addslashes() and stripslashes().

    Hope that helps.

    ---John Holmes...
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    61
    Rep Power
    15
    Oh it helps all right! Thank you very much.

Similar Threads

  1. Tabulating int in db fields and posting to a web page
    By deltatonic in forum MySQL Help
    Replies: 2
    Last Post: January 18th, 2004, 12:33 PM
  2. Loop Through fields prevent same value being entered!!!
    By arfan786 in forum ASP Programming
    Replies: 2
    Last Post: November 20th, 2003, 01:55 AM
  3. T_String Query
    By KingSwing in forum PHP Development
    Replies: 15
    Last Post: October 11th, 2003, 04:11 AM
  4. help: how NOT to overwrite certain fields?
    By crillywaslon in forum MySQL Help
    Replies: 3
    Last Post: September 19th, 2003, 03:26 PM
  5. changing double quotes to single quotes..
    By muisje in forum PHP Development
    Replies: 1
    Last Post: September 15th, 2003, 05:37 AM

IMN logo majestic logo threadwatch logo seochat tools logo