Missing Aliases - Use SQL Query to populate from other field

by Dtorr1981   Last Updated June 28, 2018 15:10 PM

Due to a process issue (i.e. client not following instructions) I have over 900 urls with missing aliases in a mosets tree table.

If possible I would like to create an SQL query that will generate and alias from the link_title by selecting say the first 3-5 words and obviously removing any numbers and special characters, replacing spaces with a - and making all characters lowercase.

MySQL skills really aren't great but so far I have created a select query for testing:

SELECT SUBSTRING_INDEX(`link_name`, ' ', 5) AS linkalias FROM `m5cob_mt_links`

Of course I'd need to convert the final into and update/insert query of some description. Could anyone provide any advice, or let me know if there is an easier way to populate all of the missing aliases?

Regards D

Tags : joomla-3.x mysql


Related Questions


Display a Value from a Specific DB Field

Updated April 30, 2016 08:04 AM


Delete users from Joomla V2.5

Updated November 08, 2016 08:04 AM

MySQL Query to show images

Updated May 10, 2017 11:10 AM