简体   繁体   中英

PostgreSQL How to get a result, transactions via php

I need transaction for update, i do:

 $sql = 'BEGIN;SET TRANSACTION ISOLATION LEVEL Serializable;
                UPDATE partner_statistic
                SET "views_count"="views_count"+1
                WHERE "id"=15
                RETURNING id;
            COMMIT;';

Transaction query success,but I use unit test, and not test this transaction But i don't get success result with pg_query, whow I can test ?

每个查询一次调用pg_query。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM