Welcome Guest, Not a member yet? Register   Sign In
Remove duplicates from Multi-dimensional array
#4

[eluser]BiSHGoD[/eluser]
Thanks guys!

You are right, going into my database is the best way. I'm actually getting this data from a large log file of all my transactions, so duplicates are valid. For this view I just want to show unique locations, other places I'll show non-unique ones.

In the end this is what worked:
Code:
$this->db->select('number,location,lid,timestamp);
        $this->db->group_by('location');
        $this->db->where('number',CI00101);
        $query = $this->db->get('log');

Thanks for the GROUP BY/DISTINCT suggestion, haven't used that with mysql before.


Messages In This Thread
Remove duplicates from Multi-dimensional array - by El Forum - 08-10-2009, 04:07 PM
Remove duplicates from Multi-dimensional array - by El Forum - 08-10-2009, 04:23 PM
Remove duplicates from Multi-dimensional array - by El Forum - 08-10-2009, 04:32 PM
Remove duplicates from Multi-dimensional array - by El Forum - 08-11-2009, 08:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB