exec(" CREATE TABLE IF NOT EXISTS contact ( id INTEGER PRIMARY KEY, name TEXT, email TEXT );" ); // Handle POST submission if (!empty($_POST)) { // Create a new contact object $contact = ORM::for_table('contact')->create(); // SHOULD BE MORE ERROR CHECKING HERE! // Set the properties of the object $contact->name = $_POST['name']; $contact->email = $_POST['email']; // Save the object to the database $contact->save(); // Redirect to self. header('Location: ' . basename(__FILE__)); exit; } // Get a list of all contacts from the database $count = ORM::for_table('contact')->count(); $contact_list = ORM::for_table('contact')->find_many(); ?> Idiorm Demo

Idiorm Demo

Contact List ( contacts)

Add Contact