I have been searching around for a few days and cannot find exactly what I looking for. Was hoping someone could point me in the right direction.

Looking to query MYSQL with keyword. For each of the records or rows its finds based on match. Would like to retrieve words or phrases that reoccur in a specific field of each the first 10 or 20 records it finds on original search.


10 Years
Discussion Span
Last Post by kyoto

Thank you for responding. I will try to give a little clearer example.

When I run a query against database using PHP script. MySql is looking through about 4 fields in the database table for matches on the original query. I have the results or rows that it finds containing a match to the query, being dumped into a temporary table, with all the data from each of the four fields.

looking to create a second process or mysql query that would look at the first 10 or 20 rows in the temporary table. Specifically one field which contains about 30 words.

Then compare each of the rows and create a list of words that re occur in each of the 10 or 20 rows. So if it finds the words "Daniweb forums" and "MySQL database help" in 3 or 4 of the rows from the temp table. Add those words to the list which will be dumped to the browser.


Use php to do the dirty work... You have regex libraries and string parsing all at your disposal.

Thank you very much iamthwee. I located some regex cheats that helped quite a bit!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.