Log in

View Full Version : if statement query



halifaxer
02-14-2008, 05:32 PM
i have one for you. trying to establish whether this is possible. we all know we can use "==" and "!=" in an if statment to determine "equal to" and "definitely not equal to."

is there something we can use that is similar to "LIKE '%whatever%'" in mysql?

i need to use an if statement to determine a list of specific products from a large database. unfortunately the only identifier is in a string with a variable. i can't be bothered to sort out a regex either. lol

cheers

Twey
02-14-2008, 06:13 PM
Er... strpos()? strstr()?

jackbenimble4
02-15-2008, 12:07 AM
We need more information. If you're searching a database, why can't you use MySQL's LIKE? Anyways, there are many ways of analyzing strings and there's no way for any of us to tell what you need in your situation without more information.