Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Member
 
Join Date: Sep 2007
Posts: 77
#1: 3 Weeks Ago
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's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 914
#2: 3 Weeks Ago

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


mysql_real_escape_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 htmlspecialchars() which will convert common symbols to their HTML character code. Useful tools on your PHP journey.
Reply