I have this sql statement which I need to pass from a form to a processing page:
$sql =
"SELECT * FROM tbl
WHERE Status LIKE '%cancel%'
AND group IN ('AA', 'BB')
ORDER BY Status, EmpLast, EmpFirst";
I run it through the addslashes:
$sqlAdd = addslashes($sql);
before I pass it. Then strip the slashes on the other side
$sqlStrip = stripslashes($_GET['sql']);
But I wasn't getting any results returned even though I knew I should be. I echoed that sql statement in the process form and this is what it because after stripping the slashes:
SELECT * FROM tbl
WHERE Status LIKE 'Encel%'
AND directorate IN ('AA', 'BB')
ORDER BY Status, EmpLast, EmpFirst
Why '%cancel%' being changed to 'Encel%' and what do I do to make it not happen anymore?