当前位置: 首页>>代码示例>>PHP>>正文


PHP Students::set_contact_no方法代码示例

本文整理汇总了PHP中Students::set_contact_no方法的典型用法代码示例。如果您正苦于以下问题:PHP Students::set_contact_no方法的具体用法?PHP Students::set_contact_no怎么用?PHP Students::set_contact_no使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Students的用法示例。


在下文中一共展示了Students::set_contact_no方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_by_id

 public function get_by_id($id)
 {
     //connect
     $this->db->connect();
     //query
     $sql = "SELECT * FROM students WHERE id=?";
     //prepare
     $stmt = $this->db->initialize($sql);
     //bind
     $stmt->bind_param("i", $id);
     //execute
     $stmt->execute();
     //bind result
     $stmt->bind_result($id, $first_name, $last_name, $email, $contact_no, $course);
     while ($row = $stmt->fetch()) {
         $student = new Students();
         $student->set_id($id);
         $student->set_first_name($first_name);
         $student->set_last_name($last_name);
         $student->set_email($email);
         $student->set_contact_no($contact_no);
         $student->set_course($course);
     }
     $this->db->close();
     return $student;
 }
开发者ID:pratishshr,项目名称:leapfrog,代码行数:26,代码来源:studentrepository.class.php

示例2: map_data

 private function map_data()
 {
     $student = new Students();
     $student->set_first_name($_POST['first_name']);
     $student->set_last_name($_POST['last_name']);
     $student->set_email($_POST['email']);
     $student->set_contact_no($_POST['contact_no']);
     $student->set_course($_POST['course_id']);
     return $student;
 }
开发者ID:pratishshr,项目名称:leapfrog,代码行数:10,代码来源:studentcontroller.php

示例3: _map_posted_data

 private function _map_posted_data()
 {
     $students = new Students();
     $students->set_first_name($_POST['first_name']);
     $students->set_last_name($_POST['last_name']);
     $students->set_email($_POST['email']);
     $students->set_contact_no($_POST['contact_no']);
     $students->set_course($_POST['course']);
     return $students;
 }
开发者ID:pratishshr,项目名称:leapfrog,代码行数:10,代码来源:studentenquirycontroller.php

示例4: get_all

 public function get_all()
 {
     $student_list = array();
     //database connect
     $this->db->connect();
     //query
     $sql = "SELECT * FROM students";
     //execute and fetch data
     $result = $this->db->fetch_query($sql);
     while ($row = $result->fetch_assoc()) {
         //put in object
         $student = new Students();
         $student->set_id($row['id']);
         $student->set_first_name($row['first_name']);
         $student->set_last_name($row['last_name']);
         $student->set_email($row['email']);
         $student->set_contact_no($row['contact_no']);
         $student->set_course($row['course']);
         array_push($student_list, $student);
     }
     return $student_list;
     $this->db->close;
 }
开发者ID:pratishshr,项目名称:leapfrog,代码行数:23,代码来源:studentrepository.class.php

示例5: Students

<?php

include_once "config.php";
include_once ROOT_PATH . "students/header.php";
require_once ROOT_PATH . "system/models/students.class.php";
require_once ROOT_PATH . "system/dbutil/dbconnection.class.php";
require_once ROOT_PATH . "system/repository/studentrepository.class.php";
$students = new Students();
$students->set_first_name($_POST['first_name']);
$students->set_last_name($_POST['last_name']);
$students->set_email($_POST['email']);
$students->set_contact_no($_POST['first_name']);
$students->set_course($_POST['course']);
$studentrepository = new StudentRepository();
$success = false;
if (isset($_POST['id']) && $_POST['id'] == '') {
    $result = $studentrepository->insert($students);
} else {
    $result = $studentrepository->update($students);
}
if ($result > 0) {
    header("location:index.php?success=true");
} else {
    header("location:index.php?error=true");
}
exit;
开发者ID:pratishshr,项目名称:leapfrog,代码行数:26,代码来源:save.php

示例6: header

require_once ROOT_PATH . "system/model/students.class.php";
require_once ROOT_PATH . "system/repository/studentrepository.class.php";
?>

<?php 
include_once "header.php";
?>

<?php 
if (!isset($_POST['submit'])) {
    header('Location: index.php');
    exit;
}
$students = new Students();
$students->set_first_name($_POST['first_name']);
$students->set_last_name($_POST['last_name']);
$students->set_email($_POST['email']);
$students->set_contact_no($_POST['contact_no']);
$students->set_course($_POST['course']);
$studentrepository = new StudentRepository();
$result = 0;
if (isset($_POST['id']) && $_POST['id'] == '') {
    echo "im here";
    $result = $studentrepository->insert($students);
} else {
    $students->set_id($_POST['id']);
    $result = $studentrepository->update($students);
}
if ($result > 0) {
    header("Location: index.php?success=true");
}
开发者ID:pratishshr,项目名称:leapfrog,代码行数:31,代码来源:save.php


注:本文中的Students::set_contact_no方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。