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

update #66

Open
istoGer opened this issue Nov 1, 2019 · 2 comments
Open

update #66

istoGer opened this issue Nov 1, 2019 · 2 comments

Comments

@istoGer
Copy link

istoGer commented Nov 1, 2019

Hi,
is there a way to increment field via update-query like:

UPDATE myTable SET counter=counter+1 WHERE id=.$tId

another class did it this way:
$data2 = ['anzahl' => $db->inc(-1)];
$db->table('myTable')->where('id', $tID)->update($data);

Thank you for support

@izniburak
Copy link
Owner

Hi @istoGer ,
This is a good suggestion. I will prepare an enhancement for this as soon as possible.
Thanks!

@istoGer
Copy link
Author

istoGer commented Nov 4, 2019

heres another nice feature :

'createdAt' => $db->now(),
// createdAt = NOW()
'expires' => $db->now('+1Y')
// expires = NOW() + interval 1 year
// Supported intervals [s]econd, [m]inute, [h]hour, [d]day, [M]onth, [Y]ear

its also from the class, I formerly used:
https://github.com/tommyknocker/pdo-database-class

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

No branches or pull requests

2 participants