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);