Hi,

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.

Thanks

Member Avatar for GreenDay2001

I didn't really get you! What do you mean? Be more clear.

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.

Member Avatar for iamthwee

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

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.