[eluser]Gavin Blair[/eluser]
Your articles can have a title ("My Article Title") and a nicename, like Wordpress does ("myarticletitle") It's just the title without caps or spaces. You could convert spaces and other characters to hyphens (-) too.
When creating the nicename, you'll want to check for duplicates so you can add the -2 if needed.
Code:
$this->db->select('nicename');
$this->db->where('nicename', $newnicename);
$query = $this->db->get('articles');
$duplicates = $query->num_rows();
if ($duplicates > 0) {
$duplicates += 1;
$newnicename = $newnicename . "-" . $duplicates;
}
$this->db->insert('articles', array( 'nicename' => $newnicename, 'title' => $newtitle, ... ));
Hope this helps!