Method 1 {code ...} method 2 {code ...} both methods can implement the operations I want, but the first method will put pressure on the server or database. The second method is to write more code {code ...} the first method in tangle
$ Bank = array (12) {["bank_id"] => string (1) "9" ["bank_type"] => string (1) "1" ["bank_operator_id"] => string (1) "2" ["bank_operator_name"] => string (9) "Tang Xinpeng" ["bank_operator_type"] => string (1) "3" ["bank_accept_id"] => string (1) "1" ["bank_accept_name"] => string (9) "Wang Changning" ["bank_accept_type"] => string (1) "1" ["bank_sum"] => string (5) "50000" ["bank_mark"] => string (3) "500" ["bank_confirm"] => string (1) "0" ["bank_create_time"] => string (10) "1467113725"} $ m-> where ($ bank)-> setField ('Bank _ confirm', '1 ');
Method 2
$ Bank = array (12) {["bank_id"] => string (1) "9" ["bank_type"] => string (1) "1" ["bank_operator_id"] => string (1) "2" ["bank_operator_name"] => string (9) "Tang Xinpeng" ["bank_operator_type"] => string (1) "3" ["bank_accept_id"] => string (1) "1" ["bank_accept_name"] => string (9) "Wang Changning" ["bank_accept_type"] => string (1) "1" ["bank_sum"] => string (5) "50000" ["bank_mark"] => string (3) "500" ["bank_confirm"] => string (1) "0" ["bank_create_time"] => string (10) "1467113725"} $ condition ['bank _ id'] = $ bank ["bank_id"]; $ m-> where ($ condition) -> setField ('Bank _ confirm', '1 ');
Both methods can implement the operations I want,
The first method causes pressure on the server or database
Second, you can write more code.
$condition['bank_id'] = $bank["bank_id"];
Tangle)
Reply content:
Method 1
$ Bank = array (12) {["bank_id"] => string (1) "9" ["bank_type"] => string (1) "1" ["bank_operator_id"] => string (1) "2" ["bank_operator_name"] => string (9) "Tang Xinpeng" ["bank_operator_type"] => string (1) "3" ["bank_accept_id"] => string (1) "1" ["bank_accept_name"] => string (9) "Wang Changning" ["bank_accept_type"] => string (1) "1" ["bank_sum"] => string (5) "50000" ["bank_mark"] => string (3) "500" ["bank_confirm"] => string (1) "0" ["bank_create_time"] => string (10) "1467113725"} $ m-> where ($ bank)-> setField ('Bank _ confirm', '1 ');
Method 2
$ Bank = array (12) {["bank_id"] => string (1) "9" ["bank_type"] => string (1) "1" ["bank_operator_id"] => string (1) "2" ["bank_operator_name"] => string (9) "Tang Xinpeng" ["bank_operator_type"] => string (1) "3" ["bank_accept_id"] => string (1) "1" ["bank_accept_name"] => string (9) "Wang Changning" ["bank_accept_type"] => string (1) "1" ["bank_sum"] => string (5) "50000" ["bank_mark"] => string (3) "500" ["bank_confirm"] => string (1) "0" ["bank_create_time"] => string (10) "1467113725"} $ condition ['bank _ id'] = $ bank ["bank_id"]; $ m-> where ($ condition) -> setField ('Bank _ confirm', '1 ');
Both methods can implement the operations I want,
The first method causes pressure on the server or database
Second, you can write more code.
$condition['bank_id'] = $bank["bank_id"];
Tangle)
Thank you for your invitation. I do not knowbank_idIs it unique? if it is the only second condition, it is enough. Although many of your first conditions have high query accuracy, I think they arestringType. if there is an index, it is fine. if there is no index, I suggest the second one if one condition is sufficient.
Thank you! bank_id must be a unique key or primary key.
$m->where(array('bank_id' => $bank['bank_id']))->setField('bank_confirm','1');
The upstairs has answered your question correctly. if bank_id is the unique key, the single-condition query is performed.
In theory, the more query conditions, the more data is filtered, and the faster the query. However, if you have a primary key or index Field and add limit = 1, the efficiency is enough.