Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(shiny)
- library(RMySQL)
- library(pool)
- pool <- dbPool(
- drv = RMySQL::MySQL(),
- user='username',
- password='password',
- dbname='words',
- host='blahblahblah')
- shinyServer(function(input, output) {
- ## function to write to databse
- writeToDB <- function(word, vote){
- query <- paste("INSERT INTO word_votes (vote, word) VALUES (", vote, ", '", word, "');", sep="")
- conn <- poolCheckout(pool)
- dbSendQuery(conn, query)
- conn <- poolReturn(conn)
- ## rest of code
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement