i want to get the field names and the row values into a single string.
example:
id | fname | gender | email
1 | john | male | [email protected]
2 | mary | female | [email protected]
select * from table where id=1
$this->db->where('id', 1);
$query = $this->db->get('table');
$row = $query->row();
$string = $row->id . $row->fname . $row->gender . $row->email;
Desire outcome:
id:1, fname:john, gender:male, email:[email protected]
or
id, fname, gender, email, 1, john, male, [email protected]
Any advise on how to construct the sql query dynamically, many thanks.