MySQL ile Toplu Güncelleme

2 Cevap php

I have a site which has client side and admin side. There is a table called account History. which contains fields like uid | accountBalance | PaymentStatus | Date.

Şimdi bu tablo tüm ücretli kullanıcılar için her ay güncellenecek olan ve tablo toplu olduğunu. Peki tablo i tüm uid bulunuyor ve güncelleştirmeyi seçmek için gereken her month.Do güncelleştirmek için en iyi yoldur.

2 Cevap

UPDATE History
SET accountBalance=val1, PaymentStatus=val2, Date=val3,
WHERE PaymentStatus=true

Ben değerlerin ne olduğunu bilmiyorum, ama böyle bir şey görünmelidir :)

Eğer sorguyu aşağıdaki gibi bir şey kullanabilirsiniz.

update history SET PaymentStatus="Paid" where accountBalance>00