Hi,
is it possible to add a new additional tag to all entries of certain category via MySQL query? Database structure does not seem so?!
thanks
Add new tag to all entries of certain category
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Add new tag to all entries of certain category
Hi!
Of course, you can do anything to date stored in serendipity with straight SQL.
However you would need a temporary storage, and its much easier to perform the query with some PHP glue:
HTH,
Garvin
Of course, you can do anything to date stored in serendipity with straight SQL.
However you would need a temporary storage, and its much easier to perform the query with some PHP glue:
Code: Select all
<?php
include 'serendipity_config.inc.php';
$newtag = "Inception";
$entries = serendipity_db_query("SELECT id FROM {$serendipity['dbPrefix']}entries");
foreach($entries AS $entry) {
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}entrytags (entryid, tag) VALUES (" . $entry['id'] . ", '" . serendipity_db_escape_string($newtag) . "')");
}
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/