Importing Geo data into wordpress database

To answer your question… Yes, it’s doable. But to give you some pointers into the right direction… I’ve known some folks who have had good success using the WordPress Importer plugin. You could conceivably export your geo data from your database (using whatever DB management tool you’re comfortable with) to the import format that this … Read more

MySQL Rank & $wpdb

You might try: SELECT NULL AS rank, player, points FROM my_table Then write a tiny loop to fill in the value for rank in each returned record?!?!? It’s a workaround rather than a solution but in the end, you’ll have what you need.

Help With MySQL to WPDB Query Conversion

Instead of using $wpdb->query(), use $wpdb->get_results(). This method allows you to specify a return type so the query is returned as an associative array. For example … $results = $wpdb->get_results( “SELECT * FROM mb_download_manager WHERE filename=”” . $namemeta . “.zip””, ARRAY_A ); This will return you an indexed array of associative arrays … so you … Read more

Using GROUP CONCAT in my-sql query with wp_usermeta table

How about a Pivot Query? This would return rows that have first_name,last_name,user_login. You could then add whatever condition you wanted using a WHERE clause. SELECT MAX(CASE WHEN wp_usermeta.meta_key = ‘first_name’ then wp_usermeta.meta_value ELSE NULL END) as first_name, MAX(CASE WHEN wp_usermeta.meta_key = ‘last_name’ then wp_usermeta.meta_value ELSE NULL END) as last_name, wp_users.user_login FROM wp_users LEFT JOIN wp_usermeta … Read more

Help with MySQL to $WPDB query

http://codex.wordpress.org/Class_Reference/wpdb query returns the number of affected rows. Instead use get_results, which returns all the rows specified by the query. You can use the second parameter to specify how these results will be returned, either as objects or as an array etc When dealing with sql, you should deal only with wpdb, there is very … Read more

How to split the a table in database?

Sharding is probably not what you want, especially if the admin area is the only problem. If things are working fine on the front end, you’re probably okay. How many posts are we talking about total? Some things worth trying (please back up your DB first!): 1. Remove all old post revisions A quick count … Read more