have a function get_autocomplete in model search
public function get_autocomplete()
{
$x = array();
$search_data = "sah";
$this->db->select('student_id,filename,random,type,mime');
$this->db->from('uploads a');
$this->db->or_like('filename',$search_data);
$this->db->or_like('random',$search_data);
$this->db->or_like('type',$search_data);
$this->db->or_like('mime',$search_data);
$this->db->join('student-record c', 'c.student_id=a.student_id', 'left');
$this->db->like('name',$search_data);
$this->db->or_like('email',$search_data);
$this->db->or_like('phone',$search_data);
$res = $this->db->get();
}
but I get error which states
Error Number: 1052
Column 'student_id' in field list is ambiguous
SELECT
student_id
,filename
,random
,type
,mime
FROM (uploads
a) LEFT JOINstudent-record
c ONc
.student_id
=a
.student_id
WHEREfilename
LIKE '%sah%' ORrandom
LIKE '%sah%' ORtype
LIKE '%sah%' ORmime
LIKE '%sah%' ANDname
LIKE '%sah%' ORphone
LIKE '%sah%'Filename: C:\wamp\www\ededge2\system\database\DB_driver.php
Line Number: 330
Help me to recover this.