Answer the question
In order to leave comments, you need to log in
How to remove all identical divs from the database using phpmyadmin?
Greetings!
Hackers stuffed 7,000 hidden blocks with different links into all posts
<div style="position:absolute;filter:alpha(opacity=0);opacity:0.001;z-index:10;display:none">.......</div>
Answer the question
In order to leave comments, you need to log in
Yes, mysql is not really needed here, php cycle select all records one by one, make the text in the variable
But make a backup. What site engine do you have?
UP Cycle (it does not apply to WP as a separate script for hosting):
// Сначала SELECT COUNT так получите $num
// Цикл на все статьи
for ($i = 0; $i < $num; $i++) {
$res = mysqli_query($link," SELECT `text`,FROM `".$table."` WHERE id='".$i."' ") or die (mysql_errno() . ": " . mysql_error(). "\n");
if($res)
{
while($row = mysqli_fetch_assoc($res))
{$did[] = $row;}
var_dump($did);
$content = $did[0]['text'];
//меняем
$contents = preg_replace('/<div\sstyle=\"position(.*?)<\/div>/ism', "", $contents);
//записываем обратно
mysqli_query($link," UPDATE `".$table."` SET `text`='".$contents."' WHERE id='".$i."' ");
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question