If I run this:
$values = array('foo' => 'foo', 'bar' => 'bar');
$sth = $pdo->prepare('SELECT :foo, :bar, :foo');
the second :foo is 0:
 => Array
[?] => 0
 => foo
 => bar
 => 0
(I also don't know why there's a ? index, but there always seems to be.)
Is there any way to get PDO to actually recognise the variables multiple times?
Specifically I want to do:
INSERT INTO table foo = :foo, bar = :bar ON DUPLICATE KEY UPDATE foo = :foo, bar = :bar
It works for inserts, but all the updates fill the record with zeros.