jacklany Posted January 31, 2008 Share Posted January 31, 2008 Hi all. So i'm trying to add, delete and update fields from a database using forms and textfields. My code works, except when there are apostrophes (') in the textfields. I suppose it conflicts with the apostrophes in the mysql_query command. Any ideas what my problem is? thanks for sharing opinions. Link to comment https://forums.phpfreaks.com/topic/88791-solved-trouble-adding-data-containing-apostrophes-to-database-please-help/ Share on other sites More sharing options...
kenrbnsn Posted January 31, 2008 Share Posted January 31, 2008 Use the function mysql_real_escape_string() on the values when you insert/update the database. Ken Link to comment https://forums.phpfreaks.com/topic/88791-solved-trouble-adding-data-containing-apostrophes-to-database-please-help/#findComment-454765 Share on other sites More sharing options...
jacklany Posted January 31, 2008 Author Share Posted January 31, 2008 So simple! It works. Thanks a lot and sorry for asking a question you've seen a thousand times. Link to comment https://forums.phpfreaks.com/topic/88791-solved-trouble-adding-data-containing-apostrophes-to-database-please-help/#findComment-454771 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.