Jump to content

brownbag

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by brownbag

  1. Sorry for the slow response. I didn't get an error but set up try/catch on someone else's advice and found the problem. Cheers.
  2. The following code is a pretty simple select doing a like and is run a few times a week with different two character values in $cclike (surrounded by %, as in '%GA%'. Yesterday it failed unexpectedly when $cclike ended up being equal to '%CI%'. I can repeat this error as much as I want but only when the value of $cclike is equal to '%CI%'. <? php $stmt = $pdo->prepare("SELECT consignor_code FROM consignors WHERE store_id =:sid and consignor_code LIKE :cc ORDER BY consignor_code DESC LIMIT 1"); $stmt->execute(['sid' => $store_id, 'cc' => $cclike]); $consignor = $stmt->fetch(); ?> Does anybody know what it is about CI that is causing this issue? Is it some form of keyword that breaks the query. Note that I can run the query with outside the php and it works fine. i.e., SELECT consignor_code FROM consignors WHERE store_id ='001' and consignor_code LIKE '%CI%' ORDER BY consignor_code DESC LIMIT 1;
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.