$dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1'); mysql_select_db('ecosmar_website', $dbcnx); $getem=mysql_query("SELECT ID FROM repdocs WHERE category='Prices'"); if(!$getem){ echo("
Could not get category. Error: ".mysql_error()."
"); }else{ while($row=mysql_fetch_array($getem)){ $changeIDs[]=$row[0]; }//while getting rows }//gotem $countem=count($changeIDs); echo("Changing $countem Rows
"); $in=0; foreach($changeIDs as $value){ $uppy=mysql_query("UPDATE repdocs SET category='Prices & Specs' WHERE ID='$value'"); if(!$uppy){ echo("Could not update ID: $value
"); }else{ $in=$in+1; } }//4each echo("Updated $in rows.
"); ?>