我想使用自适应支付api,据我所知,我只能将它用于5或6个记录。有没有一种方法可以自动化这个过程,例如,获取6条记录,对结果调用函数,然后从这6条记录中再次启动该过程?
我不能使用任何php数据库类,因为我在一个wordpress插件中使用它。仅供参考:https://codex.wordpress.org/Class_Reference/wpdb#SELECT_Generic_Results
示例结果:
Array
(
[0] => Array
(
[seller_paypal1] => yehuda@site.com
[commission1] => 16.5
)
[1] => Array
(
[seller_paypal2] => yehuda@site.com
[commission2] => 16.5
)
[2] => Array
(
[seller_paypal3] => yehuda@site.com
[commission3] => 16.5
)
[3] => Array
(
[seller_paypal4] => yehuda@site.com
[commission4] => 16.5
)
[4] => Array
(
[seller_paypal5] => yehuda@site.com
[commission5] => 16.5
)
[5] => Array
(
[seller_paypal6] => yehuda@site.com
[commission6] => 16.5
)
[6] => Array
(
[seller_paypal7] => yehuda@site.com
[commission7] => 16.5
)
)
<?php
// just a fiction way for example
foreach ($records /5 as record) {
start record 0-5
adaptive($record['seller_paypal'], $record['commission']);
//5 records finished start from the 6-11
}
function adaptive($seller_email,$commission) {
// stuff here
}
发布于 2014-02-23 22:30:20
PDOStatement::fetchAll
-返回包含所有结果集行的数组,或者根据需要返回数组
https://stackoverflow.com/questions/21969506
复制相似问题