Removing \ from php/mysql insert -
i have insert statement using php/mysql in wordpress environment , when creates new entry has apostrophe in title (like mike's post) database adds \ name. looks mike\'s post in mysql. how can remove when sql insert performed inserts mike's post. i'm not sure if wordpress gets in way , complicate things not.
note: stripslashes has done nothing far , on shared hosting cannot access php.ini, assume magic quotes on.
echo "<td><a href=\"http://example.com?writing=$all[sid]\">$all2[name]</a></td>";
don’t care char. safe mysql_* function.
please check magic_quotes_gpc
option in php.ini.
if(get_magic_quotes_gpc()){ //enabled //auto stripped without slashes when select row . } else { //disabld //please use stripslashes stripped slashes. $col = stripslashes($row['col']); }
stripslashes()
returns string backslashes before characters need escaped. these characters single quote ('), double quote ("), backslash () , nul (the null byte).
Comments
Post a Comment