Trouble binding parms with LIKE w/Oracle
Posted: Tue Jun 11, 2002 1:56 pm
Hey guys and gals,
Having a bit of a rough time binding a parm with a LIKE statement
If I write
all is well and fine.
However,
gets me
OCIBindByName: ORA-01036: illegal variable name/number in script name.
Thinking maybe it was the % symbol it was choiking on I moved the % to the var
$myUser = "%blah%";
Still same error.
So, ok, it is the single quote. Move that into the var and...I get no results (already verified it should get results). I'm guessing the single quote must be in the sql when it gets parsed.
Any ideas suggestions?? TIA
Having a bit of a rough time binding a parm with a LIKE statement
If I write
Code: Select all
SELECT user_id, addr1
FROM USER
WHERE UPPER(USERNAME) LIKE '%$user%'However,
Code: Select all
SELECT user_id, addr1
FROM USER
WHERE UPPER(USERNAME) LIKE '%:uname%'
OCIBindByName($sth, ":uname", $myUser, -1);OCIBindByName: ORA-01036: illegal variable name/number in script name.
Thinking maybe it was the % symbol it was choiking on I moved the % to the var
$myUser = "%blah%";
Still same error.
So, ok, it is the single quote. Move that into the var and...I get no results (already verified it should get results). I'm guessing the single quote must be in the sql when it gets parsed.
Any ideas suggestions?? TIA