Skip to content
Kevin Gerken edited this page Jun 25, 2018 · 1 revision

Syntax

leya.getWhere(table, column, conditionColumn, operator, value)

Description

Returns the value of one or multiple fields in the database, where the specified condition is true.

Parameters

  • table The table you want to search in
  • column The column you want to get
  • conditionColumn The column you are testing
  • operator The operator to specify for example if a value should be less than something
  • value The value you are testing with

Operators

  • < less than
  • <= less than or equal
  • > greater than
  • >= greater than or equal
  • = equal
  • != not equal

Returns

  • String Value of the field, when there is only one result
  • Array Values of the field, when there are multiple results
  • -1 row doesn't exist

Example

; We are looking in the table "users" for the "name" column, where rank is less than 5
lowPlayers := leya.getWhere("users", "name", "rank", "<", 5)
    
; show 3 players
msgbox % lowPlayers[1] lowPlayers[2] lowPlayers[3]
Clone this wiki locally