Method: OnlyofficeMysqlHelper::MySQLHelper#select_records

Defined in:
lib/onlyoffice_mysql_helper/mysql_helper.rb

#select_records(table_name, condition = '') ⇒ Object

Select table records

Parameters:

  • table_name (String)

    of table

  • condition (String) (defaults to: '')

    to filter

Returns:

  • (Object)

    result of select



53
54
55
56
57
58
59
# File 'lib/onlyoffice_mysql_helper/mysql_helper.rb', line 53

def select_records(table_name, condition = '')
  send_query do
    query = "SELECT * FROM `#{table_name}`"
    query += " #{condition}" unless condition == ''
    "#{query};"
  end
end