[eluser]charlesmudy[/eluser]
[quote author="ηυмвєяσηє" date="1306416823"]please fix the title, Its so ugly.
About your problem, you should change your sql query. Something like this :
Code:
$q = "SELECT student.first_name, student.last_name, student.status_id, student.nationality_id, courses.name FROM student, courses WHERE student.course_id = courses.id"
[/quote]
I tried it but still not working.
My controller:
Quote:public function get_student()
{
$id = $this->uri->segment(3);
$data['query'] = $this->db->query("SELECT firstname, lastname, status_id, nationality_id, course_name FROM students, courses WHERE course_id = courses.id");
$this->load->view('student_view', $data);
//echo site_url("http://localhost/database/index.php/students/student_view");
}
My view:
Quote:<?php echo "Course: " . " " . $row->course_id; ?><br />
<?php echo "Nationality: " . " " . $row->nationality_id; ?>
Error message:
Quote:Personal Data Information for John
First-name: John
Last-name: Baptise
Status: 0
A PHP Error was encountered
Severity: Notice
Message: Undefined property: stdClass::$course_id
Filename: views/student_view.php
Line Number: 11
Course:
Nationality: 3