<?php function processCheckReminder() { $this->db->executeStatement("SELECT checkReminder(" . $this->given["checked"] . ");"); return $this->processShowCurrent(); } function processShowCurrent() { $sql = "SELECT * FROM current_reminders WHERE for_id=" . $this->user->userData["user_id"] . " OR (id_advert IS NOT NULL AND for_id IS NULL) order by activate_date"; $ret = $this->db->loadAllRecords($sql) ; return $ret; } ?>
funkcja "checkReminder" ustawia flagę "widzialne" na true natomiast widok "current_reminders" pokazuje tylko te wiersze, które były niewidziane.
problem wygląda następująco:
po odpaleniu funkcji processCheckReminder(), flaga jest ustawiana na true, natomiast w widoku widoczność jest jeszcze jako false. dopiero w następnym "obiegu" widoczność jest jako true. dostawienie "commit;" nic nie pomaga. składniowo wszystko jest wporządku, chodzi tylko o to opóźnienie.
mam postgresa w wersji 8.0.3