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

Delete

Delete

The delete can be performed in a table by just sayng the name of the table you want to delete registers into.

Example

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

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

$tableName = "users";

//the method creates the query : DELETE FROM users;
$delete = $ivoryOrm->delete($tableName, $props);

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

Example Using Where

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

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

$tableName = "users";

$whereDelete[] = [
    "propName" => "id",
    "fieldValue" => 10,
];

//the method creates the query : DELETE FROM users WHERE id = 10;
$delete = $ivoryOrm->delete($tableName);
$deleteWhere = $ivoryOrm->where($delete, $whereDelete);

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

← UpdateMin and Max →
  • Delete
  • Example
  • Example Using Where
Repository Link
Copyright © 2020 Kevin da Silva