Niccolò Machiavelli said this quote

For this can be said of men in general: that they are ungrateful, fickle, hypocrites and dissemblers, avoiders of dangers, greedy for gain; and while you benefit them, they are entirely yours, offering you their blood, their goods, their life, their children,...when need is far away, but when you actually become needy, they turn away. (translated by Wayne A. Rebhorn)