Will reducing mysql permissions hinder WP function? [duplicate]

WordPress absolutely does need “DELETE“, otherwise it has no way to delete posts or tags or options rows or anything else. The “DROP” command is sometimes used during upgrades, although it’s been a long time. The last time I think it was used was during the WordPress 2.3 update, which removed the assorted categories tables … Read more

Getting data from Mysql Table..confusing

Bulk of WP’s native data structures aren’t meant for direct MySQL access. They are typically accessed via PHP APIs which take care of MySQL generation/execution and many more things, such as allowing to filter data, caching it for performance, and so on. Your issue here is that from MySQL point of view meta values aren’t … Read more

Why doesn’t custom mysql query return results? Is syntax correct?

You’re including the table prefix, but $wpdb takes care of that. Change: $query = $wpdb->prepare( “SELECT * FROM $wpdb->wp_terms INNER JOIN $wpdb->wp_term_taxonomy ON ($wpdb->wp_terms.term_id = $wpdb->wp_term_taxonomy.term_id) WHERE $wpdb->wp_terms.name LIKE %s AND $wpdb->wp_terms.count > 0”, $wpdb->esc_like($keyword) . ‘%’); To: $query = $wpdb->prepare( “SELECT * FROM $wpdb->terms INNER JOIN $wpdb->term_taxonomy ON ($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id) WHERE $wpdb->terms.name LIKE … Read more

WPDB secure custom form

When getting user input to be stored on database, a good way to proceed is: Data validation: validate the data according whith the data you expect. For example: HTML string, number, email, URL, any text with no HTML, ect. Never trust on user input or client-side validation. You can make here also some sanitization, but … Read more