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

Insert

Insert

The insertion in the table using ivory can be very simple and quick.Look at the examples.

Example

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

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

//props is an array that contains the key that is the name of the field in the table an their value will be the value it should save in the table
$props = array();
$props["name"] = "Jon";
$props["age"] = 20;

$tableName = "users";

//the method creates the query : INSERT INTO users (name, age) VALUES ('Jon', 20);
$insert = $ivoryOrm->insert($tableName, $props);

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

← Order ByUpdate →
  • Insert
  • Example
Repository Link
Copyright © 2020 Kevin da Silva