Single quotes and MYSQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chriso
Forum Commoner
Posts: 31
Joined: Fri Aug 01, 2003 11:52 am

Single quotes and MYSQL

Post by chriso »

When entering data into a mysql database, I get an error when a single quote is in the text. I know this is a special character for mysql, but:

1. How can I enter a single quote in the the database? For example, a word may indicate the possessive, such as Frank's car.

2. How do I bring the single quote back to a form field with the data for editing?

Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[php_man]addslahes()[/php_man] or better [php_man]mysql_escape_string()[/php_man] or it's brother..
Post Reply