I am trying to use a wildcard with a variable in a mySQL LIKE command for my Livecode database routine. I am a novice so I know I must be just putting the % in the wrong spot. This is what I have -
put revQueryDatabase( theConnectionID, "select * from hospaccess.v_LogFile_Viewed where UserID = '"&gpUID&"' and Organization like '"&gOrganization&"'") into theCursor
gOrganization can be in a sting of characters so I would like it to be %gOrganization% but I can not figure out where to place the "%" to be accepted in my livecode line of code
Any suggestions?
MySQL variable with a wildcard
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: MySQL variable with a wildcard
Code: Select all
put revQueryDatabase( theConnectionID, "select * from hospaccess.v_LogFile_Viewed where UserID = '"&gpUID&"' and Organization like '%"&gOrganization&"%'") into theCursor
and before second single quote
Re: MySQL variable with a wildcard
Perfect - Thank you so much