Extracted CSV as Array for Custom Query Loop
Extracted CSV as Array for Custom Query Loop
Extracted CSV as Array for Custom Query Loop
How much post meta data is too much?
Turns out this works. global $wpdb; $postsTable = $wpdb->posts; $results = $wpdb->get_results( ‘SELECT * FROM ‘.$postsTable.’ WHERE post_type = “page” OR post_type = “post” AND post_status = “publish”‘);
Custom user query – orderby meta_key (that may not exist)
In your code you are using “AND terms.name=”shorelineorwaterway” where I don’t think shorelineorwaterway is your term name, it could be your terms slug. So you can modify this by “AND terms.slug = ‘shorelineorwaterway’ and here inside inverted commas you can use hyphen. If you need to use term name then “AND terms.name=”Your Term Name” would … Read more
In usermeta table WordPress stores many serialized data. So direct meta_value would not work I think. So try the below query- SELECT a.id, a.user_email, a.user_registered, a.user_login, b1.meta_value AS first_name, b2.meta_value AS last_name, b3.meta_value AS qualified, b4.meta_value AS referrer, b5.meta_value AS view_type, b6.meta_value AS ref_by, b7.meta_value AS wp_optimizemember_custom_fields FROM wp_users AS a INNER JOIN wp_usermeta AS … Read more
In your code it is actually counting the query you have inserted in $testargs. In your case you entered one. So it is giving you back one. If you need to get the count on WordPress users table then write the query like below- global $wpdb; $total_query = “SELECT COUNT(*) FROM {$wpdb->users} AS total_count”; $total … Read more
If it is easy to do, best practice is to have all wordpress installs use their own DB. Yes it is mainly for security, but it also simplifies tasks like importing and exporting sites. If you must have several sites on one DB, then all of them have to have different prefix, and there is … Read more
Possible to restore wordpress database from mysql56 and sqlite files?
Actually I’ve discovered the trigger is actually the loading of the page. So Disregard please. I will need to dig further and have the timer do the triggering 🙂 Thanks!