vgrabovets
9/27/2016 - 3:33 PM

runQuery

runQuery

runQuery = function(query, cyrillic = FALSE){
     if (cyrillic) {
          Sys.setlocale("LC_CTYPE", "russian")
     }
     library(RMySQL)
     mydb = dbConnect(MySQL(), user='WWBQ9O', password='08ZN1D', dbname='megogo2', 
                      host='193.187.76.250')
     dbGetQuery(mydb, "SET NAMES cp1251")
     query.res = dbGetQuery(mydb, query)
     dbDisconnect(mydb)
     return (query.res)
}