Is that & turned into &before the quote function, or in it?
I ask because that looks like an HTML escaping, not an SQL escaping.
SuiteCRM is very messy when it comes to cleaning up text for “security” reasons. It does a lot of over-zealous cleaning. Sometimes your most straight-forward answer is just to use str_replace for that particular character.
I actually have this function in one of my projects :
public static function undoCleanUp($overZealouslyCleanedUpString) {
You have to do the replacement after SuiteCRM has changed it for you. I’m not sure when and where that happens, thus the question at the start of my post.
Watch out when examining these things when debugging, if you echo things onto the browser, & will show as &. Make sure you’re looking at something that shows you the contents exactly as they are (like the Watch window in an IDE)