本文整理汇总了PHP中Course::set_course_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Course::set_course_name方法的具体用法?PHP Course::set_course_name怎么用?PHP Course::set_course_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course::set_course_name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_student_courses
public function get_student_courses($order = null)
{
LoadHelper::model('course');
$student_list = array();
//connect to database
$this->db->connect();
//query
$sql = "SELECT s.id,s.first_name,s.last_name,s.email,s.contact_no,c.id as course_id,c.course_name ";
$sql .= " FROM students s JOIN courses c on s.course_id=c.id";
if (isset($order)) {
$sql = $sql . " ORDER BY " . $order;
}
//fetchquery
$result = $this->db->fetchquery($sql);
while ($row = $result->fetch_assoc()) {
$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']);
$course = new Course();
$course->set_id($row['course_id']);
$course->set_course_name($row['course_name']);
$student->set_course($course);
array_push($student_list, $student);
}
$this->db->close();
return $student_list;
}
示例2: get_all
public function get_all($order = null, $where = NULL)
{
$course_list = array();
//connect to database
$this->db->connect();
//query
$sql = "SELECT * FROM courses";
if (!is_null($where)) {
$sql = $sql . " WHERE " . $where;
}
if (!is_null($order)) {
$sql = $sql . " ORDER BY " . $order;
}
//fetchquery
$result = $this->db->fetchquery($sql);
while ($row = $result->fetch_assoc()) {
$course = new Course();
$course->set_id($row['id']);
$course->set_course_name($row['course_name']);
$course->set_added_date($row['added_date']);
$course->set_status($row['status']);
array_push($course_list, $course);
}
$this->db->close();
return $course_list;
}
示例3: map_data
private function map_data()
{
$Course = new Course();
$Course->set_course_name($_POST['course_name']);
$Course->set_status($_POST['status']);
return $Course;
}
示例4: get_all
public function get_all()
{
$course_list = array();
$sql = "SELECT * from course";
$this->db->connect();
$result = $this->db->fetch_query($sql);
while ($row = $result->fetch_assoc()) {
$course = new Course();
$course->set_id($row['id']);
$course->set_course_name($row['course_name']);
$course->set_duration($row['duration']);
$course->set_status($row['status']);
array_push($course_list, $course);
}
return $course_list;
$this->db->close();
}