Details
Description
I found some strange result from variable reference on bindParam and gave me quite a lot to figure out what happened with the strange result. I do not know if this issue results from PDO library or Zeta.
My test on QueryInsert library on testingSeveralInsertOnDatabase section give me the strange result:
and Here is chunk of test code:
{{{
...
function testingSeveralInsertOnDatabase()
...
}}}
I am expecting result for this:
{{{
Array
(
[0] => Array
(
[id] => 1
[0] => 1
[company] => cfSystem
[1] => cfSystem
[section] => Norway
[2] => Norway
[employees] => 20
[3] => 20
)
[1] => Array
(
[id] => 2
[0] => 2
[company] => IBM
[1] => IBM
[section] => Norway
[2] => Norway
[employees] => 70
[3] => 70
)
)
}}}
but the component gives me result of this:
{{{
Array
(
[0] => Array
(
[id] => 1
[0] => 1
[company] => cfSystem
[1] => cfSystem
[section] => cfSystem
[2] => cfSystem
[employees] => 20
[3] => 20
)
[1] => Array
(
[id] => 2
[0] => 2
[company] => IBM
[1] => IBM
[section] => IBM
[2] => IBM
[employees] => 70
[3] => 70
)
)
}}}
I suspect this issue arises from & (by-reference) operator of bindParam method on ezcQuery class.
My quick-fix is change code on ezcQuery class, doBind method from bindParam to bindValue since BindValue have exactly what result I needed.
{{{
...
foreach( $this->boundParameters as $key => $val )
{
try
catch( \PDOException $e ) { }
}
...
}}}
tha'ts all