insert WITH 1 primary key

insert($generate_id = 1)

If $generate_id is set to false (0), primary_key must already be set before this function will run.

All fields that cannot be null must already be set. System will attempt to blindly add the record based on the currently set fields.

For single primary key tables, inserts references from lookup tables only if the lookup table has exactly 2 fields.

Example:

example.php
<?php
include("lib.php");
load("person");

$p = new person();
$p->set_name("Bob");
if (!
$p->insert())
{
    echo 
"Failed to insert";
    return 
0;
}
echo 
"Insert Successful";

?>