Ivory ORM Docs

Ivory ORM Docs

  • Docs

›SQL Syntax

SQL Syntax

  • First-Steps
  • Select
  • Select Distinct
  • Where
  • And, Or and Not
  • Order By
  • Insert
  • Update
  • Delete
  • Min and Max
  • Count, Avg and Sum
  • Like
  • In
  • Between
  • Alias
  • Joins
  • Union
  • Group By
  • Having
  • Exists
  • Any & All
  • Procedures

Between

Between

The steps to use the sql between property with a where condition using ivory just involves a few properties more.

Example

//import the ivory class
require_once('Operations.php');

//the instance of the ivory
$ivoryOrm = new Operations();

$arrSelect[] = "name";
$arrSelect[] = "email";

$tables[] = "users";

$arrWhere[] = [
    "propName" => "age",
    "fieldValue" => "",
    "isBetween" => true,
    "first-comparative" => 30,
    "second-comparative" => 80,
];

//the method select creates the query : SELECT name,email FROM users WHERE age BETWEEN 30 AND 80;
$select = $ivoryOrm->select($arrSelect, $tables);
$selectWhere = $ivoryOrm->where($select, $arrWhere);

//the method runQuery is responsible to literally run your query into the database;
$result = $ivoryOrm->runQuery($selectWhere);

← InAlias →
  • Between
  • Example
Repository Link
Copyright © 2020 Kevin da Silva