Welcome Guest, Not a member yet? Register   Sign In
news story titles in urls
#7

[eluser]adrian westlake[/eluser]
Great, so I do something like the following (pseudocode)?

Code:
$urltitle = url_title($title)
$title = $this->uri->segment(3);
$q = $this->db->getwhere('blog', array('urltitle' => $title));
if($this->db->num_rows()==0){
   //insert record into database with $urltitle as the title field
}
else{
   //insert record into database with $urltitle appended with a unique number
   $urltitle = $urltitle."_".($this->db->num_rows()+1);
}


Messages In This Thread
news story titles in urls - by El Forum - 06-22-2007, 07:54 AM
news story titles in urls - by El Forum - 06-22-2007, 08:33 AM
news story titles in urls - by El Forum - 06-22-2007, 08:43 AM
news story titles in urls - by El Forum - 06-22-2007, 09:20 AM
news story titles in urls - by El Forum - 06-22-2007, 10:18 AM
news story titles in urls - by El Forum - 06-22-2007, 06:06 PM
news story titles in urls - by El Forum - 06-23-2007, 02:26 AM
news story titles in urls - by El Forum - 06-23-2007, 04:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB