We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
$builder = $db->table('mytable'); $builder->set('field', 'field+1', FALSE); $builder->where('id', 2); $builder->update(); // gives UPDATE mytable SET field = field+1 WHERE id = 2
($builder->set('field', 'field+1', FALSE);) this is bug !!!!
error: UPDATE mytable SET field = 'field+1' WHERE id = 2
mytable
id
The text was updated successfully, but these errors were encountered:
Yeah, those situations have always been painful for CI's Query Builder IIRC. I got to where I was writing those queries manually.
However, there's new increment() and decrement() methods in Query Builder you can use instead:
decrement()
$db->table('mytable') ->where('id', 2) ->increment('field', 1);
Note that these do run the query right then, though...
Sorry, something went wrong.
No branches or pull requests
$builder = $db->table('mytable');
$builder->set('field', 'field+1', FALSE);
$builder->where('id', 2);
$builder->update(); // gives UPDATE mytable SET field = field+1 WHERE id = 2
($builder->set('field', 'field+1', FALSE);) this is bug !!!!
error: UPDATE
mytable
SET field = 'field+1' WHEREid
= 2The text was updated successfully, but these errors were encountered: