Advertisement
Guest User

Untitled

a guest
Sep 9th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. function getFormSubmitTime(){
  2. var form = FormApp.openById('dfsjfeifcnxzc121ii3ZZy');
  3. var formResponses = form.getResponses();
  4. var formResponse = formResponses[formResponses.length-1];
  5. var gettime = formResponse.getTimestamp();
  6. }
  7.  
  8. function myonFormSubmit(e)
  9. {
  10. var ts=e.values[0];
  11. runQuery("INSERT INTO `TABLENAME` (`timestamp`,....) VALUES ('ts')");
  12. }
  13.  
  14.  
  15. function runQuery(qry)//This is pretty bare bones as it has no error handling built in. I removed it from a much more complicated function. Which you can find in the link in the text below.
  16. {
  17. var address='address';
  18. var user='user';
  19. var userPwd='pass';
  20. var db='db';
  21. var dbUrl='jdbc:mysql://' + address + '/' + db;
  22. var conn=Jdbc.getConnection(dbUrl, user, userPwd);
  23. var stmt=conn.prepareStatement(qry)
  24. stmt.execute();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement