Simple and short:
- mysql_query() = Faster!
- $wpdb->get_results() = Safer!
But in most cases since $wpdb
is a global object and already in the memory using it will be be as fast as mysql_query()
.
Will this affect my performance?
It can affect for better performance changes but they would be minor changes that its just not worth it.
Related Posts:
- Differences between wpdb->get_results() and wpdb->query()
- How to Use Wildcards in $wpdb Queries Using $wpdb->get_results & $wpdb->prepare?
- wpdb get posts by taxonomy SQL
- Multipart/formatted MySQL query problem
- Custom $wpdb Query for Custom Post Type by Category
- Can’t pass table to $wpdb->prepare
- $wpdb->get_var not returning a result
- Most effective use of DB querys
- $wpdb->query() vs. $wpdb->get_results() vs. phpMyAdmin
- wpdb::prepare() isn’t working
- $wpdb doesn’t appear to work on page inside of a plugin
- Strange string in console from wpdb query
- Using $wpdb->update but confused on the WHERE in and SET
- What’s wrong with my $wpdb prepare?
- Make one query for adding entries to database
- How to execute a SQL-query which contains multiple queries using $wpdb->query?
- Alter a specific query on WordPress
- wpdb->term_taxonomy count posts from both published and private posts?
- wpdb print all post meta
- Plugin will sort users by usermeta
- wpdb query problem to access previous 3 days posts
- How to write: $wpdb->update having WHERE NOT value pair in the array
- I can’t figure out what’s wrong with this statement. $wpdb->query update
- wpdb COALESCE won’t work
- Custom Query – Based on user input
- Custom SQL Query passing array to WHERE p.id
- Get posts from category with custom query
- Custom Query returns array, but I can’t see it’s elements
- Valid SQL query return empty
- mysql query – how to escape apostrophe?
- $wpdb->prepare affecting the query?
- prepare function sql safe method
- Updating with $qpdb->query() always returns 0 rows affected
- How to return count of custom post type posts with a specific custom field value via $wpdb?
- WordPress Mysql query and Duplicate
- How do I query for posts by custom meta and those that have been stickied?
- Help with Related Posts Function
- wpdb update multiple row?
- Formatting a date/time returned from a custom $wpdb query
- Improve performance of slow query
- How do I get specific readable results from this query and array results
- implementing my wp_query using $wpdb class
- Exclude Posts from a Widget
- Fastest and most efficient SQL query to check if UID exists
- Use $wpdb->get_results with filter based on array
- $wpdb query for price in custom field value
- Display result from custom post meta query
- Wpdb empty result only if language is Russian
- Run an update query in a function
- How to fix this insert? Don’t work for me!
- Problem on wpdb queries, wp_insert_post, wp_insert_user etc. The query runs twice
- Update vs Insert logic but the last key is always inserted?
- There is way to improve this query? wordpress get post data and some meta data
- $wpdb: how to use a query as a base for another query?
- Wpdb generates too many queries
- Custom Query for searching through custom fields
- Mysql query and odd results
- How to reference same column name but different table in custom db query
- Retrieving custom field array value through db query
- How to get one result using wpdb class?
- Delete query won’t run
- update $wpdb one query
- get_results using wpdb
- Get all image from single page using this query
- Add multiple value to a query variable in WordPress
- wp_dropdown_categories with multiple select
- get post id using the $query_vars variable
- Is there a conditional tag for latest post or do i need a query?
- get_posts() loop returns the same the_title() for each post
- Temporarily storing main search result
- convert custom query to wp_query
- Select two sums with single get_var statement
- Help with MySQL to $WPDB query
- sql select query in wordpress ‘page’ [closed]
- Group custom post listing in admin section
- problem with sql query in wordpress plugin
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Searching With Apostrophe
- plugin code is pulling information from database in one instance and not in other. What is wrong?
- List author’s posts with SQL
- Where is the query in wp-login.php
- Order posts by recent comments
- query if page has not child
- What is wrong with my wp query, cant exclude the category that i want
- how to replace old DW site with new WP site? [closed]
- Order terms by count – missing terms
- Querying Advanced Custom Fields
- How to rearrange a pool of posts joined using two queries?
- Can I include get_posts in this array?
- Custom query Custom-Post-Types creates error
- Rewrite rule for query params
- Hook into the Admin Dashboard and redirect users
- Doing $wpdb->get_results returns NULL, doing the same query in my DB returns correct value
- Displaying data from custom table
- SEO friendly query vars
- Prevent versioning for .woff (font) files
- Orderby event date (if it exists) or post date (if it doesn’t) – how to reorder posts based on meta value OR date
- OR condition not working
- Query not returning child posts for any parent post ID
- SQL Query : how copy all tags of post into their post content in wordpress by sql query