PDO Bind Variables Errors - Fails on Enterprise when bindvars repeated
Date: November 14, 2008 04:33PM
I am having an odd problem using PHP 5.2.x with PDO.
$binds = array('my_id' => 10000, 'name' => 'Bob');
$sql = "SELECT * FROM my_table WHERE id = :my_id AND id = :my_id"; // redundant, I know, but demonstrates the error as simply as possible
$sql2 = "INSERT INTO my_table (id, name) VALUES (:my_id, :name) ON DUPLICATE KEY UPDATE name = :name";
When I execute either of these statements in our MySQL Community server, they both work fine.
When I execute either of them in my clients' MySQL Enterprise database they both fail due to no value being present in the second instance of the bind variable.
Any idea on why this is working differently on different versions?
Thanks!
- Brian
Sorry, you can't reply to this topic. It has been closed.
© 1995-2008 MySQL AB, 2008- Sun Microsystems, Inc.