As harryvan so rightly pointed out, the number of pixels is not the only factor that defines image quality. The resolution is also important. Even if you have a 10 megapixel camera, if you take pictures at low resolution they won't look good.
There are many other parameters that are important to check when buying a digital camera