For buying shares ,as an investors, they should do the due diligent works before buying them otherwise blindly buying shares whose represented companies are probably about to collapse will lead you lose all of the investment. Buying shares sometimes likes gamble as well. You should know what you are doing then you will be safe with your money. In gamble you should know how to control yourself.
Even though if one don't buy shares without proper study but still they will not lose all of there investment in just one day or in few minutes like people lose money in gambling so I don't agree on both investing shares and gambling are same but both have a different kinds of risks.