a textbox with character like ", how to insert it to database?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • perhapscwk
    New Member
    • Sep 2007
    • 123

    a textbox with character like ", how to insert it to database?

    a textbox with character like ", how to insert it to database?


    when form submit, it seem the insert data to database is okay
    but it skip everything after the character ", why?

    thanks.
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    mysql_real_esca pe_string() will escape characters that are unfriendly for MySQL and PHP generally, but you should be filtering and checking every input from the user to protect yourself from SQL injection. That link is a good beginners tutorial, but you should read some other articles which will be revealed by a quick Google search.

    You should also look into htmlspecialchar s() which will convert common symbols to their HTML character code. Useful tools on your PHP journey.

    Comment

    Working...