-1
在此过程之前,我尝试使用此代码显示仅用户表,它工作得很好。我想要从Codeigniter中的SQL中获取最新记录
$this->db->join('tablename', 'tblanswers.answerid = credentials.cid', 'right outer');
在此过程之前,我尝试使用此代码显示仅用户表,它工作得很好。我想要从Codeigniter中的SQL中获取最新记录
$this->db->join('tablename', 'tblanswers.answerid = credentials.cid', 'right outer');
我认为你可以这样做:
$this->db->query("SELECT * FROM tblanswers ORDER BY answerid DESC LIMIT 1")->row();
更多关于这一点,你可以在这里找到:https://www.codeigniter.com/user_guide/database/results.html
$this->db
->join('tablename', 'tblanswers.answerid = credentials.cid', 'right outer')
->order_by('title', 'DESC');
它工作正常,但它能够更好地使用DB函数。像order_by()和limit() –