-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 66e52be
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE student ( | ||
id_student INT(11) KEY AUTO_INCREMENT, | ||
identification_number VARCHAR(11) NOT NULL, | ||
name varchar(50) NOT NULL, | ||
age INT(2) NULL, | ||
preferences TEXT | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
class student extends ODBObject{ | ||
public $identification_number; | ||
public $name; | ||
public $age; | ||
public $preferences; | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
require_once "../objectDB/objectDB-mysql-v3.0.php"; // this will include first | ||
require_once "student.php"; | ||
|
||
// load all students in database | ||
$db = new objectDB(); | ||
$students_list = $db->getObjs('student'); | ||
|
||
// remove first student | ||
$students_list[0]->remove(); | ||
|
||
// remove second student | ||
$db->removeObj($students_list[1]); | ||
?> |