Prevent creation of unused database tables?

I’m afraid it won’t be easy to do (if possible at all). These tables are empty and you don’t use them, but… There are still many SQL queries that use them in JOINs. It means, that if you remove these tables, these JOINs queries will cause errors. There are many functionalities in backend, that use … Read more

How do join in query with WordPress

I have one solution global $wpdb; $db= $wpdb->prefix.’booking’; $dbAdditonal= $wpdb->prefix.’booking_additionals’; $booking = $wpdb->get_results(” SELECT b.*, IFNULL(GROUP_CONCAT(ba.NamePack SEPARATOR ‘<br />’),’N/A’) Extras, FORMAT(IFNULL(SUM(ba.Price),0)+IFNULL(b.Price,0),2) AS Total FROM $db b LEFT JOIN $dbAdditonal ba ON b.Id_Booking = ba.Fk_IdBooking GROUP BY Id_Booking “,ARRAY_A);

$wpdb->get_var returns 0

Your count for that query may be 0. Make sure $wpdb->tablex is correct. Also, definitely use $wpdb->prepare $user_followed = $wpdb->get_var( $wpdb->prepare( “SELECT COUNT( * ) AS total FROM {$wpdb->tablex} WHERE type = %d AND active = %d AND user_id = %d”, 4, 1, $user_id ) );

problem with quotes on new post

$post_content=”&quot;Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…&quot;”; Try encoding special characters. See: http://www.w3schools.com/tags/ref_entities.asp & http://php.net/manual/en/function.htmlentities.php

WordPress: Interact with Database Query Data and Login

Connecting a mobile app directly to the database is possible, but ill-advised. WordPress provides great tools for integrating your application with your site using the XML-RPC interface. WordPress has open-source Android and iOS applications, so there’s some great source code there to get you started. http://codex.wordpress.org/XML-RPC_WordPress_API http://ios.wordpress.org/development/ http://android.wordpress.org/development/ In addition, the Jetpack plugin provides a … Read more

WordPress database error Unknown column

There is a SQL query in the theme file /themes/ExtraGrid/content-single.php, and it is asking for a column that doesn’t exist. This seems to be a commercial theme, so we can just guess why that query exists. Maybe you forgot to set a required theme option, or your tables are just incomplete.

Using queries in and i see 7000+queries?

195 queries for one page is a lot. 7000 queries is not a lot, it is insane. Install Query Monitor. It tracks all queries and presents them in groups. I don’t know if it can track that many queries, this is probably an interesting stress test. 🙂 Find the source of those queries, deactivate it. … Read more