[Sqlrelay-discussion] bind pear php module
Brought to you by:
mused
From: david f. <df...@vi...> - 2005-05-20 14:12:31
|
Hello so Here is the request $db->autoExecute("myTable", $lstField, DB_AUTOQUERY_INSERT); this build the several request (inside PEAR DB) INSERT INTO myTable (col1,col2,col3) VALUES (?,?,?) But it seems that when it reach the execute fonction, it's not able to fill the ?, with the right data. Analysing the function I discover this : function &execute(&$sqlrcursor, $data = false) { sqlrcur_clearBinds($sqlrcursor->cursor); if ($data) { while ($element = current($data)) { $index = key($data); sqlrcur_inputBind($sqlrcursor->cursor, $index, $data["$index"]); next($data); } } .......... I try to modify it like : function &execute(&$sqlrcursor, $data = false) { sqlrcur_clearBinds($sqlrcursor->cursor); if ($data) { while ($element = current($data)) { $index = key($data); if(is_numeric($index)) $index = "?"; sqlrcur_inputBind($sqlrcursor->cursor, $index, $data["$index"]); next($data); } } .......... without success. Please thanks for your help livingdead |