ScottCybak
Programmer
Hello, i'm trying to run a simple search query, but am running into problems while creating the Sql string.
In access:
WHERE [RefNum] Like '*asdf*'
works perfectly, but when i create the string in PHP and access via odbc_exec it fails:
WHERE [RefNum] Like '*$strWhat*'
sadly, if i echo the sql and paste the php query into access it works perfectly as it should. I tried using \" (escaped double quotes) but for some reason access rejects them and the odbc_exec gives me an error. Access usually prefers " over 's.
So, Like "*asdf*" would be Like \"$strWhat\"
This isn't working - is there something i'm missing? Scott Cybak
Nighthawk Transport Inc.
In access:
WHERE [RefNum] Like '*asdf*'
works perfectly, but when i create the string in PHP and access via odbc_exec it fails:
WHERE [RefNum] Like '*$strWhat*'
sadly, if i echo the sql and paste the php query into access it works perfectly as it should. I tried using \" (escaped double quotes) but for some reason access rejects them and the odbc_exec gives me an error. Access usually prefers " over 's.
So, Like "*asdf*" would be Like \"$strWhat\"
This isn't working - is there something i'm missing? Scott Cybak
Nighthawk Transport Inc.