25 lines
767 B
PHP
25 lines
767 B
PHP
<?php
|
|
require 'db/config.php';
|
|
try {
|
|
$pdo = db();
|
|
$pdo->beginTransaction();
|
|
|
|
$updates = [
|
|
'ANILLO FENG SHUI' => 'anillo feng shui',
|
|
'CADENA SAN MIGUEL ARCANGEL' => 'cadena san miguel arcangel',
|
|
'RODILLERA DE COMPRESIÓN LARGAS AJUSTABLE POWERFLEX©' => 'rodillera de compresión largas ajustable powerflex©'
|
|
];
|
|
|
|
foreach ($updates as $upper => $lower) {
|
|
$stmt = $pdo->prepare("UPDATE products SET nombre = :upper WHERE nombre LIKE :lower");
|
|
$stmt->execute(['upper' => $upper, 'lower' => $lower . '%']);
|
|
}
|
|
|
|
$pdo->commit();
|
|
echo "Nombres de productos actualizados a mayúsculas.";
|
|
|
|
} catch (PDOException $e) {
|
|
$pdo->rollBack();
|
|
echo "Error al actualizar nombres: " . $e->getMessage();
|
|
}
|
|
?>
|