I am getting user review in one table. In another table I am storing most occurring words in the review with their frequency value.
If new review added, it may contain new words or already existing word into list.
if it is new, then add into list. Other wise update the occurrence of words into table.
Is there any mysql, php function to handle this sort of scenario?
You can use the ON DUPLICATE KEY UPDATE logic explained on MySQL.com, it sounds like it will solve your problem.