Timeline for Python MySQL INSERT unicode
Current License: CC BY-SA 4.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 21, 2018 at 8:31 | comment | added | user4691770 | @MartijnPieters - thank you! I have modified the code to reflect all 3 of your suggestions (I owe you 3 beers). Of course no need to iterate with the commas gone, the SQL parameters are in place and the code is running quicker than it was before. My function is working nicely, I can now build on this for my project! | |
| Oct 21, 2018 at 8:27 | vote | accept | Community Bot | ||
| Oct 20, 2018 at 19:17 | comment | added | Martijn Pieters | @JamesPy with the latest updates the iteration issue should be resolved too. Sorry about that, my attention is a bit divided at the moment, I should have spotted that earlier. | |
| Oct 20, 2018 at 19:13 | comment | added | Martijn Pieters | @AbdullahRazzaki aha! That’s where there is an attempt at iteration. | |
| Oct 20, 2018 at 19:12 | history | edited | Martijn Pieters | CC BY-SA 4.0 |
added 453 characters in body; added 50 characters in body; added 66 characters in body; added 2 characters in body; added 6 characters in body
|
| Oct 20, 2018 at 19:09 | comment | added | Abdullah Razzaki |
@JamesPy I suppose you're getting the error because ktime is an int now so you can just remove the for loop too and it should work. Remove the commas, I didn't notice the commas. @Martjin's right
|
|
| Oct 20, 2018 at 19:04 | comment | added | Martijn Pieters |
@JamesPy PyMySQL uses %s placeholders, yes.
|
|
| Oct 20, 2018 at 18:55 | comment | added | user4691770 | Martjin thank you for your response, it's a really good answer with a lot of detail. If I remove the trailing commas (sqlMac = c['kismet.device.base.macaddr']) then I'll get a TypeError as you can't iterate over 'int' objects. The SQl parameters - fair enough, I'm using PyMySql. I'll look into that. For now I got this working by following the advice of @AbdullahRazzaki in the comment below my question. | |
| Oct 20, 2018 at 18:53 | history | edited | Martijn Pieters | CC BY-SA 4.0 |
deleted 211 characters in body
|
| Oct 20, 2018 at 18:41 | history | edited | Martijn Pieters | CC BY-SA 4.0 |
added 126 characters in body; deleted 3 characters in body
|
| Oct 20, 2018 at 18:31 | history | answered | Martijn Pieters | CC BY-SA 4.0 |