I'm having two tables in my database, and I wan't to check if the fruits (ex: banana) is matches any rows in the table "check" in the row "list". If there is any matches, $checkdupe == 'yes ('.$fetch1['amount'].')'; if not, $checkdupe == 'no';.
Select all values, keep an array keyed by primary key, with a value of an integer representing how many times that particular value has been counted, then prune out anything with a value of 1 and run it thru array_keys
I doubt you will need any PHP code for doing this, but still I can't understand your DB design.
Could you post your DB schema and some real world values from you tables?
There are 10 types of people in this world, those who understand binary and those who don't