Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update sorgusu refactor edilecek #8

Closed
hasimyerli opened this issue May 16, 2019 · 0 comments
Closed

update sorgusu refactor edilecek #8

hasimyerli opened this issue May 16, 2019 · 0 comments
Assignees

Comments

@hasimyerli
Copy link
Owner

hasimyerli commented May 16, 2019

Not: Blog yazısı yazılacak.
trans_status kullanımı hatalı sürekli "true" dönüyor. Bu durumda _mysqli->info içinde gelen string ifade parse edilerek bir sonuç üretilir yada prosedür yazılır. Örn:

BEGIN

SET @prevNote = NULL;
UPDATE mobi_kitapyurdu_test.mylib_libproduct ml SET ml.note = IF(@prevNote := ml.note, _note, _note)
WHERE ml.libproduct_id = _libproduct_id AND ml.customer_id = _customer_id;

IF @prevNote = _note THEN
    SELECT 1 AS affected_rows;
ELSE
    SELECT ROW_COUNT() AS affected_rows;
END IF;

END

@hasimyerli hasimyerli self-assigned this May 16, 2019
hasimyerli added a commit that referenced this issue May 16, 2019
hasimyerli added a commit that referenced this issue May 18, 2019
mysqli->info string bilgisi özel string parse yapılarak sorgu hakkında elde edilen bilgi isChangedRows() metodu içinde kontrol edildi. Kayıt eşleşmiş fakat güncelleme olmamış ise yani formdaki veriler aynı gelmiş ve mysql kayıtlar güncel olduğu için update işlemi yapmamışsa bu metod true döner.
@hasimyerli hasimyerli reopened this May 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant