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).

http://php.net/manual/en/function.stripslashes.php


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -