Remove a higher quantity from stock according to a variation

Thank to Akshat who gave me the first step here, after searching more i found this and it’s was exactly what i wanted
I hope this can help some other

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)