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

Select Distinct

Select Distinct

The steps to made a select distinct in ivory are very similar to the steps used in the process of wirting a query.

Example

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

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

//an array where you add all the field names of the fields you want to  select
$arrSelect[] = "DISTINCT(country)";
$arrSelect[] = "email";

//an array where you add all the table names you want to  select
$tables[] = "users";

//the method select creates the query : SELECT DISTINCT(name),email FROM users;
$select = $ivoryOrm->select($arrSelect, $tables);

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

← SelectWhere →
  • Select Distinct
  • Example
Repository Link
Copyright © 2020 Kevin da Silva