DarkPrince2005 Posted October 31, 2007 Share Posted October 31, 2007 I have a web form that needs to save to a database but when there is any apostrophe in the field that needs to be saved it doesn't save at all. is it maybe because the insert statement looks like: insert into dis values('$_POST[comment]'); that the single quotations for $_POST is clashing with the apostrophe? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted October 31, 2007 Share Posted October 31, 2007 you can look at the php command addslashes() http://php.net/addslashes Quote Link to comment Share on other sites More sharing options...
DarkPrince2005 Posted October 31, 2007 Author Share Posted October 31, 2007 ok it seems that it'll work, but how would that look in a mysql statement Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted October 31, 2007 Share Posted October 31, 2007 it will be something like the following fieldname = 'value\'' something like the above Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.