Hi! try this code:
You HAVE TO USE STR_REPLACE
<?php
//set up variables and enter your credentials here
$dbname = "name";
$dbhost = "localhost";
$dbpass = "pass";
$dbuser = "name";
$tbl_name = "oc_attribute_description";
//set up your master array! Array goes in this or
$mstr_array = array(
"Packs", "Packets",
"Manual", "Manual Book");
//connect to database
$con = mysql_connect($dbhost, $dbuser, $dbpass) or die('no connection:' . mysql_error());
$db = mysql_select_db($dbname) or die ('cant select db: ' . mysql_error());
// reteive each column
$sql = "SHOW COLUMNS FROM '".$tbl_name."'";
$res = mysql_query($sql) or die ('could not get columns: ' . mysql_error());
$find = 0;
$replace = 1;
while ($col = mysql_fetch_array($res)) {
$sql = "UPDATE '".$tbl_name."' SET '".$col[0]."' = STR_REPLACE(".$mstr_array[$find].", '".$mstr_array[$replace]."' , '".$col[0]."')";
$find = $find + 2;
$replace = $replace + 2;
}
?>