Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where input parameters were sent as part-indexed, part associati... #71

Closed
wants to merge 1 commit into from

Conversation

hellogerard
Copy link
Contributor

...ve array

Hello,

Thanks for taking over the project. I updated idiorm with great anticipation and ran into an error on a simple update. Taking the example from the test, the following code:

$widget = ORM::for_table('widget')->find_one(1);
$widget->name = "Fred";
$widget->age = 10;
$widget->save();

passes the test because it is not actually executed. Upon execution, I get the following error:

SQLSTATE[HY093]: Invalid parameter number: parameter was not defined

If I dump out the input parameters sent to execute() (line 1285), I get:

array(3) {
  'name' => string(4) "Fred"
  'age' => int(10)
  [0] => string(1) "1"
}

PDO does not seem to like the mix of named and indexed parameters. This PR fixes this so that the input parameters are all indexed array values.

Gerard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant