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 only on integer keys? #11

Closed
madaolex opened this issue Sep 6, 2018 · 2 comments
Closed

Update only on integer keys? #11

madaolex opened this issue Sep 6, 2018 · 2 comments

Comments

@madaolex
Copy link
Contributor

madaolex commented Sep 6, 2018

Hi!

There is one limitation in your function updateMultipleRows, it works only if $index is integer.
But if you use instead of

$query = "UPDATE `$table` SET " . substr($cases, 0, -2) . " WHERE `$index` IN(" . implode(',', $ids) . ");";

this:

$query = "UPDATE `$table` SET " . substr($cases, 0, -2) . " WHERE `$index` IN(" . '"' . implode('","', $ids) . '"' . ");";

you can use strings as $index too.

I use this almost two months now, no crashes or errors.

@eaharonoff
Copy link

@madaolex can you submit the PR? Would love that functionality added here!

@madaolex
Copy link
Contributor Author

madaolex commented Sep 19, 2018

@eaharonoff Done. #12
I hope I did it right, because I do not have much experience.

@mavinoo mavinoo closed this as completed Sep 20, 2018
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

No branches or pull requests

3 participants