我正在 CodeIgniter 框架中运行此查询。代码如下
$this->db->select('*');
$this->db->from('tbl_exam_marks');
$this->db->where('examid','9');
$query=$this->db->get();
$s4 = $query->row();
这个生产者创建一个像这样的查询
SELECT * FROM tbl_exam_marks
WHERE examid
= '9'
但没有行返回。 当我在 MySQL 表上运行查询时,它返回一行
最佳答案
使用 get_where
尝试此代码希望它会对您有所帮助
$data = $this->db->get_where('tbl_exam_marks', array('examid' => 9))->row_array();
关于mysql - sql查询返回null但表有多条记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49955946/