I normally use mySQL but I am working on a PostgreSQL db and have found that things I normally do in mySQL don't work the same for queries in PostgreSQL. Anyway being new to building queries in PostgreSQL I need some help.
I am trying to build a simply query that'll try and find a match or anything that contains what a user my type. For example:
Say the user types in the search box: Bob
Say I have in my database:
Bob Jones
John Bob Jones
Bobo Jones
Bobolio Jones
Mike Jones
Steve Jones
Steve Bob Jones
I want it to find anything that is simular or contains BOB upper case, lower case whatever. So it would returen only these records because they contain bob .
Bob Jones
John Bob Jones
Bobo Jones
Bobolio Jones
Steve Bob Jones
I am looking for a query that I normally would write like this for a mySQL DB but for a PostgreSQL DB:
$query="SELECT name FROM table WHERE name REGEXP $search_query";