That's what happens when we don't follow the basic rules of gambling. But I think you have learnt your lesson.
Most of us have faced this because of the uncontrollable urge to recover the money we lost in the previous bets.
Thus we end up using all our money to recover the amount we used since the start of gambling.
But it's better to limit our losses for the day and come back another day if we are losing a lot on a particular day.
Controlling the emotions is where many fail and hence lose all their money.