Guest User

Untitled

a guest
Apr 12th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ui <- fluidPage(
  2. numericInput("nrows", "Enter the number of rows to display:", 5),
  3. tableOutput("tbl")
  4. )
  5.  
  6. server <- function(input, output, session) {
  7. output$tbl <- renderTable({
  8. conn <- dbConnect(
  9. drv = RMySQL::MySQL(),
  10. dbname = "apilogs",
  11. host = "localhost",
  12. username = "root",
  13. password = "root")
  14. on.exit(dbDisconnect(conn), add = TRUE)
  15. dbGetQuery(conn, paste0("SELECT * FROM logs where key = 'agc' LIMIT ", input$nrows, ";"))
  16.  
  17. })
  18. }
  19.  
  20. dashboardSidebar(
  21. selectInput("Filter", "Filter:",
  22. choices = c())
  23. )
Add Comment
Please, Sign In to add comment