It is still confusing... Is megapixel everything?
Megapixel comes with dpi (dots per inch). Megapixel is an unit to measure how many pixels per width and length is a photograph. It determines print size !!! that's it.
An example: If a photo is 600 by 800 pixels, it is 600x800=480.000 pixels which is called 0,5 megapixel photo. This size photo can not be printed on a 9x13 paper without any magnifiny on the photo which shows corners of pixel dots.
Megapixel does not show the quality or sharpness of a photo. It only shows how big is the picture...
Picture quality depends on processor, sensor, lens...
If you buy a 3 mp compact camera and think that it will shoot better photos then a small fine jpeg shot (appx 2.5 megapixel) of an D200, you are far beyond reality.
Here are some charts to understand better.