Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1420

General Questions/New to Joomla! 5.x • Re: Batch Article Edit

$
0
0
Here is an example how to replace missing author ids in bulk by running a SQL script in phpMyAdmin.

The first statement sets the user id of the new author. The CREATE statement creates a temporary table. The subsequent query finds all the articles where the author details cannot be found and adds the article ids to a temporary table, which is then accessed to update those articles with the new author.

The same pattern can be used to update the column 'modified_by'. Replace 'ep28r' with your own table prefix.

Code:

SET @author = 123;DROP TEMPORARY TABLE IF EXISTS deleted_users;CREATE TEMPORARY TABLE deleted_users (`id` int(10) unsigned NOT NULL, PRIMARY KEY (`id`))SELECT c.id FROM ep28r_content cLEFT JOIN ep28r_users u ON c.created_by = u.idWHERE u.id IS NULL;UPDATE ep28r_content c SET c.created_by = @authorWHERE c.id IN(SELECT d.id FROM deleted_users d);

Statistics: Posted by toivo — Thu Nov 14, 2024 1:34 am



Viewing all articles
Browse latest Browse all 1420

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>