alecthorne Posted February 3, 2013 Share Posted February 3, 2013 Hello all. I am trying to change the 'Alias Slug' that a Joomla article uses to make each article unique. This needs to be achieved within a PHP routine, and thus far I have achieved the following: $slugreplace = "12345"; $query = "UPDATE yoo_zoo_item SET alias=$slugreplace WHERE id=$id"; This replaces the slug with "12345". However I would like to combine an integer with a string, as below $id = $row['id']; //this is the unique article item number $name = $row['name'];//this is the article title $slugreplace = $id.$name; $query = "UPDATE yoo_zoo_item SET alias=$slugreplace WHERE id=$id"; The original slug is not replaced. In fact, only when the variable $slugreplace contains an integer, is the slug replaced. Any value that contains a string is ignored. However I can replace the alias within Joomla itself to be any string/integer combination. What am I missing?? I have posted this on the Joomla forum, but no answer as yet. Maybe I am missing something with PHP here ? Thanks, Alec Link to comment https://forums.phpfreaks.com/topic/273977-updating-the-alias-slug-for-joomla-with-php/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.