run_replace() function not working properly
-
Hi,
Thank you for providing this very useful plugin. Though, I think I found a bug in the run_replace() function. I needed to move the line:
$data_to_fix = $row[$current_column];
above the foreach( $replace_array as $search_for => $replace_with) loop and also add:
$data_to_fix = $edited_data;
…at the end of the same loop. Else I think it will only be the last search string in the replace_array that will cause an update in each column.
I also had some problems with UTF-8 coding and swedish signs. It helped if I fetched data with:
global $wpdb; $data = $wpdb->get_results( $SQL, ARRAY_A );
…instead of
$data = mysql_db_query($db, $SQL, $cid);
…and updated it with:
$wpdb->query($UPDATE_SQL);
…instead of:
$result = mysql_db_query($db,$UPDATE_SQL,$cid);
…else the unserialze function was not able to unserialize the fetched data.
Br, Hans
- The topic ‘run_replace() function not working properly’ is closed to new replies.