$wpdb doesn’t like to store arrays

Don’t store serialised PHP data in the database! It can be a major security risk! When the contents of the value are deserialised, any objects get recreated and their constructors and wakeup methods run, this can be used to launch an attack. Additionally, that data can’t be search replaced, because PHP serialised strings contain values … Read more

Doubt using $wpbd->get_col for a single column

Try this. Hopefully I’ve interpreted your output correctly. I’d recommend a good read of the $wpdb codex, particularly in relation to the get_col() method – http://codex.wordpress.org/Class_Reference/wpdb#SELECT_a_Column global $wpdb; // You won’t need this unless this code is within a function $query = $wpdb->prepare( ‘SELECT %1$s.guid FROM %1$s’, $wpdb->posts ); $results = $wpdb->get_col($query); $counter = 1; … Read more

Image thumbnails not available post migration, but still accessible via direct URL – DB issue

Domain change This kind of error may be caused by wrong host name in image urls that are stored in the database. It is necessary to replace strings holding your old domain with new one: http://olddomain.com –> http://newdomain.com In every migtration process I use the following recommended tool: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ Upload it to your WP root … Read more

what is the best way to store user created data?

You should store additional user data in wp_usermeta table. For that, use add_user_meta() function. Here’s an example of how you can store locations $location = array(‘name’ => ‘example location name’, ‘street’ => ‘example street name’, ‘note’ => ‘example user note’ ); add_user_meta($user_id, ‘location’, $location); You can store as many locations as you want. To retrieve … Read more