gerkintrigg Posted April 30, 2007 Share Posted April 30, 2007 Hiya. I've made databases and queried them for a good few years, but I've only ever looked for where things are in the database field. What I want to do is see whether the text string contains a database field content so: If the database has a field called "phrase" and in that field is the phrase "how are you", and the text string contains: "how are you feeling?", I want the query to find the database record and output the reply. I've done it if the string contains the field, but never if the field contains the string. is this possible without looping through loads of records? Thanks. Link to comment https://forums.phpfreaks.com/topic/49336-if-a-database-field-content-is-in-a-string/ Share on other sites More sharing options...
Barand Posted April 30, 2007 Share Posted April 30, 2007 WHERE INSTR('$searchtext', phrase) > 0 Link to comment https://forums.phpfreaks.com/topic/49336-if-a-database-field-content-is-in-a-string/#findComment-241801 Share on other sites More sharing options...
gerkintrigg Posted April 30, 2007 Author Share Posted April 30, 2007 thanks Baranad - I can always count on you! Link to comment https://forums.phpfreaks.com/topic/49336-if-a-database-field-content-is-in-a-string/#findComment-241885 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.