Skip navigation links

MySQL Forums


Advanced Search

PDO Bind Variables Errors - Fails on Enterprise when bindvars repeated
Posted by: Brian Gallagher ()
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

Options: ReplyQuote


Subject Written By Posted
PDO Bind Variables Errors - Fails on Enterprise when bindvars repeated Brian Gallagher 11/14/2008 04:33PM
Re: PDO Bind Variables Errors - Fails on Enterprise when bindvars repeated Brian Gallagher 11/17/2008 11:30AM


Sorry, you can't reply to this topic. It has been closed.