检索仅链接到该会话的数据
Retrieve data only linked to that session
我需要获取 UserID_Staff
与会话 StaffID
匹配的数据
我的查询
$this->db->select('Report_Comments.Comments, Report_Comments.Comment_Date staff.Staff_Username')
->from('Report_Comments')
->join('staff', 'Report_Comments.UserID_Staff = staff.StaffID')
->where('UserID_Staff', $this->session->userdata("StaffID"));
return $result = $this->db->get();
知道为什么会出现此错误,以及如何更改我的查询吗?
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.`Staff_Username` FROM `Report_Comments` JOIN `staff` ON `Report_Comments`.`User' at line 1
SELECT `Report_Comments`.`Comments`, `Report_Comments`.`Comment_Date` `staff`.`Staff_Username` FROM `Report_Comments` JOIN `staff` ON `Report_Comments`.`UserID_Staff` = `staff`.`StaffID` WHERE `UserID_Staff` = '3'
Filename: models/report/Report_model.php
Line Number: 115
$this->db->select('Report_Comments.Comments, Report_Comments.Comment_Date ,staff.Staff_Username')
->from('Report_Comments')
->join('staff', 'Report_Comments.UserID_Staff = staff.StaffID')
->where('UserID_Staff', $this->session->userdata("StaffID"));
return $result = $this->db->get();
您在 Report_Comments.Comment_Date , staff.Staff_Username
附近错过了 ','
我需要获取 UserID_Staff
与会话 StaffID
我的查询
$this->db->select('Report_Comments.Comments, Report_Comments.Comment_Date staff.Staff_Username')
->from('Report_Comments')
->join('staff', 'Report_Comments.UserID_Staff = staff.StaffID')
->where('UserID_Staff', $this->session->userdata("StaffID"));
return $result = $this->db->get();
知道为什么会出现此错误,以及如何更改我的查询吗?
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.`Staff_Username` FROM `Report_Comments` JOIN `staff` ON `Report_Comments`.`User' at line 1
SELECT `Report_Comments`.`Comments`, `Report_Comments`.`Comment_Date` `staff`.`Staff_Username` FROM `Report_Comments` JOIN `staff` ON `Report_Comments`.`UserID_Staff` = `staff`.`StaffID` WHERE `UserID_Staff` = '3'
Filename: models/report/Report_model.php
Line Number: 115
$this->db->select('Report_Comments.Comments, Report_Comments.Comment_Date ,staff.Staff_Username')
->from('Report_Comments')
->join('staff', 'Report_Comments.UserID_Staff = staff.StaffID')
->where('UserID_Staff', $this->session->userdata("StaffID"));
return $result = $this->db->get();
您在 Report_Comments.Comment_Date , staff.Staff_Username
附近错过了 ','