init
This commit is contained in:
22
modules/Accounts/repairDoubleNames.php
Executable file
22
modules/Accounts/repairDoubleNames.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$query = "SELECT id, name FROM ecmproducts";
|
||||
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
|
||||
$ile =0;
|
||||
$ile_nie =0;
|
||||
while ($row=$GLOBALS['db']->fetchByAssoc($result)) {
|
||||
$name = $row['name'];
|
||||
if (strlen($name) % 2 == 0) {
|
||||
$start = substr($name, 0, strlen($name)/2);
|
||||
$end = substr($name, strlen($name)/2, strlen($name)/2);
|
||||
|
||||
if ($start == $end) {
|
||||
$query2 = "UPDATE ecmproducts SET name = '".$start."' WHERE id ='".$row['id']."';";
|
||||
//$GLOBALS['db']->query($query2);
|
||||
echo $query2."<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "koniec";
|
||||
?>
|
||||
Reference in New Issue
Block a user