This kind of works, but $cnt returns the seller id that the buyer has bought from the least amount of times, rather than the most. I've tried changing 'nooftimes' to 'ASC' but it still gives me the lowest seller rather than the highest?
Whether the seller id is primary key or duplicates will occur? if duplicates occur for several times for a buyer then that will be the favourite r8? if not duplicates occur then how would you said a particular as favourite? or am not clearly understand?