Ben şöyle call_user_func_array ve mysqli_stmt :: bind_param kullanmaya çalışıyorum:
# A. prepare an insert query statement
$this->_stmt = $db_link->prepare('INSERT INTO foo (col1, col2) VALUES (?,?)');
# B. bind a placeholder array to the statement
$bound = array('col1' => null, 'col2' => null);
call_user_func_array(array($this->_stmt, 'bind_param'),
array($types_string, &$bound));
# C. while there are records, retrieve, munge, and insert
while ($row = $res->fetch_assoc()) {
$bound = transform($row); # $bound remains an array indexed as 'col1', 'col2'
$this->_stmt->execute(); # PHP Notice: Array to string conversion
}
Ben dize dönüşüm diziye lider, PHP referanslar karıştı alıyorum. Ya ben adım B altında doğru tutucu dizi bağlayıcı değilim, ya da ben adım C. doğru tutucuya atama değilim
(Benzer sorular daha önce sorulmuş olan, ama benim için bir cevap bulamadım.)