Posted: Thu Jun 01, 2006 10:43 am
Wowee! That look just the thing...nearly.
This only seems to work for the first link it finds on the page!?
This only seems to work for the first link it finds on the page!?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$res = mysql_query("
SELECT
`link`.`id` as `link_id`,
`font`.`id` as `font_id`,
`font`.`content`
FROM
`DomElements` `link`
INNER JOIN
`DomElements` `font`
ON `font`.`parent` = `link`.`id`
WHERE
`link`.`nodeName` = 'A'
AND `font`.`nodeName` = 'FONT'
AND `link`.`target`
");
while(list($link_id, $font_id, $content) = mysql_fetch_row($res)) {
mysql_query("DELETE FROM `DomElements` WHERE `id` in ($link_id, $font_id)");
mysql_query("INSERT INTO `DomElements` SET `nodeName` = `text`, `content`='$content'");
}