Skip to content

Commit

Permalink
DataSources\NetteDatabase: Fixed method for EDITABLE column
Browse files Browse the repository at this point in the history
  • Loading branch information
o5 committed Nov 2, 2014
1 parent be993b9 commit ca4187f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DataSources/NetteDatabase.php
Expand Up @@ -72,7 +72,7 @@ protected function makeWhere(Condition $condition, \Nette\Database\Table\Selecti
public function update($id, array $values, $idCol)
{
return (bool) $this->getSelection()
->where("? = ?", $idCol, $id)
->where(array($idCol => $id))
->update($values);
}

Expand Down

3 comments on commit ca4187f

@o5
Copy link
Owner Author

@o5 o5 commented on ca4187f Nov 2, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ví někdo, jak se řeší escape sloupce?

  1. ->where("? = ?", $idCol, $id) - nefunguje v MySQL protoze z toho vyleze WHERE 'idCol' = 'id' (misto ` se prida apostrof)

  2. ->where(array($idCol => $id)) - jak jsem zjistil je to same jako ->where("$idCol = ?" => $id))

:/

@o5
Copy link
Owner Author

@o5 o5 commented on ca4187f Nov 2, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hrach: poradíš pls? :)

@hrach
Copy link

@hrach hrach commented on ca4187f Nov 2, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.