diff options
Diffstat (limited to 'easyCRUD/index.php')
-rw-r--r-- | easyCRUD/index.php | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/easyCRUD/index.php b/easyCRUD/index.php index 65891df..e77c04e 100644 --- a/easyCRUD/index.php +++ b/easyCRUD/index.php @@ -1,32 +1,32 @@ -<?php - require("Person.class.php"); +<?php +// Require the person class file + require("Person.class.php"); -// Our person object - $person = new Person(); +// Instantiate the person class + $person = new Person(); -// Create new person - $person->Firstname = "Kona"; - $person->Age = "20"; - $person->Sex = "F"; - $creation = $person->Create(); +// Create new person + $person->Firstname = "Kona"; + $person->Age = "20"; + $person->Sex = "F"; + $creation = $person->Create(); +// Update Person Info + $person->id = "4"; + $person->Age = "32"; + $saved = $person->Save(); -// Update Person Info - $person->id = "4"; - $person->Age = "32"; - $saved = $person->Save(); +// Find person + $person->id = "4"; + $person->Find(); -// Find person - $person->id = "4"; - $person->Find(); - - echo $person->Firstname; - echo $person->Age; + echo $person->Firstname; + echo $person->Age; // Delete person - $person->id = "17"; - $delete = $person->Delete(); + $person->id = "17"; + $delete = $person->Delete(); // Get all persons - $persons = $person->all(); + $persons = $person->all(); ?>
\ No newline at end of file |