Posts Tagged ‘query’
Move WordPress to a new domain / location
Tuesday, May 25, 2010 0:25 No CommentsHow to move WordPress to a new location in few steps. – move files, addapt .htaccess, wp-config.php if needed - backup database – run the following queries (replace old_url.tld, new_url.tld with actual data) UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old_url.tld’, ‘http://www.new_url.tld’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’; UPDATE wp_posts SET guid = replace(guid, [...]
MySQL – Get the Top N of a Group
Friday, March 26, 2010 11:43 No CommentsGetting Top N of a group would be very easy if there just wasn’t that ‘LIMIT & IN/ALL/ANY/SOME subquery’ restriction. But there’s always some way around. Thx to Jon Armstrong from A little Noise for the code hint. MYSQL table ‘measurements’ | Id | Freq | Level | DateM ## Gets the last 2 measurements [...]