I am trying to execute the following PHP code but am getting 0 rows in return even though there is a matching row when executed in command line:
$sql = "SELECT TOP 1 * FROM [Coupons] WHERE [code] LIKE '%?%' AND [platform] LIKE '%?%'";
$stmt = odbc_prepare($link, $sql);
odbc_execute($stmt, array($coupon,$platform));
How do I properly format the LIKE's in the query?
I tried
$sql = "SELECT TOP 1 * FROM [Coupons] WHERE [code] LIKE ? AND [platform] LIKE ?"
but that doesn't work either.
Any advice?