Guest User

Untitled

a guest
Oct 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. {
  2. cars: [
  3. {
  4. manufacturer: "Ford",
  5. model: "F-150",
  6. color: "blue",
  7. year: 2002
  8. },
  9. {
  10. manufacturer: "Dodge",
  11. model: "Durango",
  12. color: "red",
  13. year: 1998
  14. },
  15. {
  16. manufacturer: "Honda",
  17. model: "Accord",
  18. color: "silver",
  19. year: 2015
  20. },
  21. // and so on
  22. ]
  23. }
  24.  
  25. db.query(
  26. "INSERT INTO vehicles SET ? ON DUPLICATE UPDATE color=VALUE(color), year=VALUE(year)",
  27. vehicleObject,
  28. function (error, response) {
  29. if (error) throw error;
  30. }
  31. );
  32.  
  33. Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the
  34. manual that corresponds to your MariaDB server version for the right syntax
  35. to use near ''[object Object]', '[object Object]', '[object Object]',
  36. '[object Object]', '[ob' at line 1
Add Comment
Please, Sign In to add comment