本文整理匯總了PHP中Student::set_dob方法的典型用法代碼示例。如果您正苦於以下問題:PHP Student::set_dob方法的具體用法?PHP Student::set_dob怎麽用?PHP Student::set_dob使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Student
的用法示例。
在下文中一共展示了Student::set_dob方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _map_posted_data
private function _map_posted_data()
{
$student = new Student();
$student->set_first_name($_POST['first_name']);
$student->set_last_name($_POST['last_name']);
$student->set_dob($_POST['dob']);
$student->set_blood_group($_POST['blood_group']);
$student->set_email($_POST['email']);
$student->set_contact($_POST['contact']);
$student->set_program_id($_POST['program_id']);
return $student;
}
示例2: get_all
public function get_all()
{
$student_list = array();
$this->db->connect();
$sql = "SELECT * from tbl_student";
$result = $this->db->fetchQuery($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$student = new Student();
$student->set_id($row['id']);
$student->set_first_name($row['first_name']);
$student->set_last_name($row['last_name']);
$student->set_dob($row['dob']);
$student->set_blood_group($row['blood_group']);
$student->set_email($row['email']);
$student->set_contact($row['contact']);
$student->set_program_id($row['program_id']);
array_push($student_list, $student);
}
}
$this->db->close();
return $student_list;
}
示例3: get_by_id
public function get_by_id($id)
{
$student = null;
$this->db->connect();
$sql = "SELECT id,first_name,last_name,dob,blood_group,email,contact,program_id from tbl_student WHERE id=?";
$stmt = $this->db->initStatement($sql);
$stmt->bind_param("i", $id);
$stmt->execute();
$stmt->bind_result($id, $first_name, $last_name, $dob, $blood_group, $email, $contact, $program_id);
while ($stmt->fetch()) {
$student = new Student();
$student->set_id($id);
$student->set_first_name($first_name);
$student->set_last_name($last_name);
$student->set_dob($dob);
$student->set_blood_group($blood_group);
$student->set_email($email);
$student->set_contact($contact);
$student->set_program_id($program_id);
}
$this->db->close();
return $student;
}
示例4: header
<?php
include_once '../config.php';
include_once ROOT_PATH . 'system/models/student.class.php';
include_once ROOT_PATH . 'system/repository/student_repository.class.php';
include_once 'header.php';
if (!isset($_POST['submit'])) {
header('location:student.php?error=nopage');
}
$student = new Student();
$student->set_first_name($_POST['first_name']);
$student->set_last_name($_POST['last_name']);
$student->set_dob($_POST['dob']);
$student->set_blood_group($_POST['blood_group']);
$student->set_email($_POST['email']);
$student->set_contact($_POST['contact']);
$student->set_program_id($_POST['program_id']);
$student_repository = new StudentRepository();
$result_add = 0;
$result_edit = 0;
if (!isset($_POST['id']) || $_POST['id'] == '') {
$result_add = $student_repository->insert($student);
} else {
$student->set_id($_POST['id']);
$result_edit = $student_repository->update($student);
}
if ($result_add > 0) {
header('location:student.php?success=true');
} elseif ($result_edit > 0) {
header('location:student.php?update=true');
} elseif ($result_edit == 0) {