Articles of database

load filtered posts from database

I made recently a form survey in my eshop asking people what they want, so now I have bunch of parameters stored in javascript variables (in an object) and I would like to load products (posts) that match the chosen parameters. Since I have never done anything similar, I am completely lost as to what […]

WordPress Database Posts Table query

So this works if I replace $wpdb->posts with the literal table name in the database, but not if I try to switch it over to $wpdb->posts.. I thought this is used to solve the databases being named wpgh, wpbs, wphh, or any other combination of wp and some characters. $results = $wpdb->get_results( ‘SELECT * FROM […]

Wrong comment meta rating calculate

I cannot make this work on my wp, after upgrading to wp 4.4+, what’s wrong in this? any changes in ratings after 4.4? thanks function calculate_average_rating( $post_id ){ global $wpdb; $result = $wpdb->get_results( $wpdb->prepare( “SELECT AVG(commentmeta1.meta_value) AS rate, COUNT(commentmeta1.meta_value) AS counts FROM {$wpdb->commentmeta} AS commentmeta1 WHERE commentmeta1.meta_key = ‘review’ AND commentmeta1.comment_id IN ( SELECT comment_ID […]

Possible to restore wordpress database from mysql56 and sqlite files?

I was building a small personal site on my local host using MAMP. I had a bunch of content and post entries that I had put in (notes I had taken for school) but something went wrong and one day (I don’t remember changing any settings prior to this) I got an error saying it […]

Halting data inserts for future refresh of post?

I am hacking a plugin to add a feature I need. I have created this code which works: if(!$active && $current_price < $start_price){ add_post_meta ( $postid,’auction_no_bid’,’1′, true ); } else if(!$active && $current_price >= $start_price){ add_post_meta ( $postid,’auction_bid’,’1′, true ); } else { echo ‘i got nuthin’; } When a timer completes its one time […]

Further use of the select value from form

I am new on the php play field and my experience is just based on VBA. I created a dropdown menu but I couldn’t use the selection of the dropbox for further steps. I would like to show after the selection a couple of database information below, based on the selection. Books and other questions […]

do I need to change the default database prefix?

when do one need to change the default database prefix OTHER THAN SECURITY REASONS? Let’s not worry about securities,so is there any preformance concerns? See I have four or more worpdress site on one server(not multiplesites),like:,,, All of them are using wordpress and sharing a same database prefix.Is there any problems for that when it […]

Accessing content from third party as native posts in WordPress

Can WordPress be architected to use external content accessed over HTTP instead of reading and writing to a database ? Size of the content available remote is simply huge and potentially modified by other tools as well. So importing into database is not a viable option. Is there any product available that can abstract wpdb […]

Error establishing a database connection – On multiple refresh only

I am running a website in wordpress which run without error. But when I refresh page or site multiple times (using F5) then it shows Error establishing a database connection other websites in that server or all other subdomain also goes down. So My wordpress is not showing any error but refreshing multiple times cause […]

Restore widget text from database

I am about giving up here and resorting to individually recreating each of 50+ sidebars. The text in all widgets has been lost from the database. I have a backup of slightly over a week ago, but in that time many changes have been made, including updates to plugins. I can’t see how to add […]