When we insert a string with ampersand character into mysql, the string is inserted only till & character is encountered.
Example: when inserting “one & two”… only “one ” is inserted.
Tried a few things like… htmlentities OR htmlspecialchars… nothing working for me.
Current PHP code:
$sms = htmlentities($_POST["sms"]);
$query = "INSERT INTO sms (detail,catID,deviceID) VALUES ('".$sms."',".$_POST["catID"].",'".$_POST["deviceID"]."')";
And as the app is live… I need to resolve it by editing the PHP files only, on the server. (I hope it can be done)
Ok, well to complete the discussion, couldn’t found a server side only solution… requires modification at both client & server side.
Here’s how I needed to pass the upload text (as newStr):
And this modification on the server side:
Special thx to @PhpMyCoder & @Shef
& LOL on the urgency!