use mysql variable in a $wpdb->query to reindex a column?

If I correctly understood, this is not possible (two queries instead of one). I ended up with this sad and time-consuming loop… :/ //get subtracks $querystr = $wpdb->prepare(“SELECT subtrack_id FROM `$subtracks_table` WHERE tracklist_id=’%d’ ORDER BY `subtrack_time` ASC”,$this->post_id); if ( !$ids = $wpdb->get_col($querystr) ) return; //update order $i = 0; foreach($ids as $id){ $i++; $wpdb->update( $subtracks_table, … Read more

I want to share local developement and staging DB — Is this very smart or very stupid?

WordPress, and many of its plugins, store configuration data in the database. That alone could cause issues for the setup you described, but the urls of every link will also be stored fully canonicalized. So, unless you plan to test your staging setup from “http://localhost“, you will have serious issues trying to click around multiple … Read more